{"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","name":"@material/slider","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections 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","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","slider"],"repository":{"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":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"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"}],"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"},"_id":"@material/slider@8.0.0-canary.00dfbf6be.0","version":"8.0.0-canary.00dfbf6be.0"}