{"id":17300974,"url":"https://github.com/imtaotao/input-range","last_synced_at":"2026-02-09T22:31:20.354Z","repository":{"id":57274323,"uuid":"135016429","full_name":"imtaotao/input-range","owner":"imtaotao","description":"Simulate native input range component.","archived":false,"fork":false,"pushed_at":"2020-04-09T09:21:40.000Z","size":2319,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-16T05:27:41.476Z","etag":null,"topics":["bar","input-range","slider"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imtaotao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-27T04:48:28.000Z","updated_at":"2022-05-20T09:55:22.000Z","dependencies_parsed_at":"2022-09-17T10:10:46.961Z","dependency_job_id":null,"html_url":"https://github.com/imtaotao/input-range","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/imtaotao/input-range","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtaotao%2Finput-range","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtaotao%2Finput-range/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtaotao%2Finput-range/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtaotao%2Finput-range/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imtaotao","download_url":"https://codeload.github.com/imtaotao/input-range/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtaotao%2Finput-range/sbom","scorecard":{"id":486497,"data":{"date":"2025-08-11","repo":{"name":"github.com/imtaotao/input-range","commit":"71d650078945ff4c75e07b8b4a701af416511105"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T17:57:21.331Z","repository_id":57274323,"created_at":"2025-08-19T17:57:21.331Z","updated_at":"2025-08-19T17:57:21.331Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271306829,"owners_count":24736770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bar","input-range","slider"],"created_at":"2024-10-15T11:31:31.268Z","updated_at":"2026-02-09T22:31:20.059Z","avatar_url":"https://github.com/imtaotao.png","language":"TypeScript","readme":"# Input range 🎉\n [![NPM version][npm-image]][npm-url]\n [![npm download][download-image]][download-url]\n [![npm license][license-image]][download-url]\n\n### [中文文档](./docs/README_zh.md)\n\nInputRange is a slide bar plugin, he simulates native `input range` component and makes you can highly customize the `dom` structure and the `css` style, if you don't want write `dom` structure and `css` style by yourself, InputRange provided `react` component and `vue` component. Detailed usage can be seen [here][example]\n\n## Effect\n![effect](./docs/img/demo.gif)\n\n## Installation\n```\n  npm install input-range --save\n```\nor\n```\n  yarn add input-range\n```\n\n## About react and vue component\n+ [react slide bar][react_doc]\n+ [vue slide bar][vue_doc]\n\n## How to use\nInputRange has two ways to initialize\n```js\n  const { Slide, createSlide } from 'input-range'\n\n  // The first\n  const slide = new Slide(options)\n  slide.init()\n\n  // The second\n  const slide = createSlide(options)\n  slide.init()\n```\nyou can initialize appropriately after `slide` instance be created, for example, a `dom` element initially hidden and later displayed\n\n## options description\n`options` except `point`，are all optional\n\n|    Name    | Description | Type | Default |\n|------------|-------------|------|---------|\n| point | slider button | element \\|\\| string | undefined |\n| direction  | slider active direction | 'x' \\|\\| 'y' | 'x' |\n| limit_area | limit range while draging | number | 100 |\n| pointer_event | whether to add the `pointer-events` attribute to the `style` of the slider  | boolean | true |\n| prohibit_click | whether to prohibit clicking slider | boolean | false |\n| prohibit_move | whether to prohibit draging slider | boolean | false |\n| click_el_index | Specifing which element of container triggers the click event (index starts from 0) | number | 0 |\n| expand_touch_area | expand touch range | Object | undefined |\n\n### expand_touch_area description\n|    Name    | Description | Type |\n|------------|-------------|------|\n| width | width | number \\|\\| string |\n| height | height | number \\|\\| string |\n\n\n## Instance attributes\n### value\n`siide.value` record current slider value, value range is `0` to `1`. It should be noted that the slide will be set to the default value according to the css value of the `slide progress` during initialization. slide doesn't provide `default value` interface, so you can achieve default value by `html` structure or `dispatch` method.\n\n```html\n  \u003cdiv class=\"container\"\u003e\n    \u003cspan class=\"background\"\u003e\u003c/span\u003e\n    \u003cspan class=\"progress\"\u003e\n      \u003ci class=\"dot\"\u003e\u003c/i\u003e\n    \u003c/span\u003e\n  \u003c/div\u003e\n\n  \u003cstyle\u003e\n    .progress {\n      width: 30%;\n    }\n  \u003c/style\u003e\n\n  \u003cscript\u003e\n    // If direction is 'x'\n    const slide = new Slide(options)\n    slide.init()\n    slide.value // 0.3\n  \u003c/script\u003e\n```\nor\n```js\n  const slide = new Slide(options)\n  slide.init()\n  slide.dispatch('change', 0.1)\n```\n\n## api\n+ #### [`init()`][init]\n+ #### [`dispatch(event_type, value, is_animate)`][dispatch]\n+ #### [`prohibit_click(prohibit)`][prohibit_click]\n+ #### [`prohibit_move(prohibit)`][prohibit_move]\n\n## Hook functions\n+ #### [`oninput`][oninput]\n+ #### [`onchange`][onchange]\n+ #### [`onerror`][onerror]\n\n## init\nYou can use `init` method to reset parameters in anytime.\n\n```js\n  const slide = new Slide(options)\n  slide.init()\n```\n\n## dispatch\nYou can trigger the event manually, yeah! `dispatch`.\n\n```js\n  // event type must be input or change\n  // value must be between 0 and 1\n  // you can use transition animate\n  slide.dispatch('input', 1, true)\n```\n\n## prohibit_click\nThis method use to prohibit clicking slide bar or cancel.\n\n```js\n  slide.prohibit_click(true)\n  // or\n  slide.prohibit_click(false)\n```\n\n## prohibit_move\nThis method use to prohibit draging slide bar or cancel.\n\n```js\n  slide.prohibit_move(true)\n  // or\n  slide.prohibit_move(false)\n```\n\n## oninput\nYou can compare this method to the callback of the `input` event of the native `input range` component.\n\n```js\n  slide.oninput = function(value, progress_el, slide) {\n    ...\n  }\n```\nYou also can achieve similiar effect by rigistering `input` event on `html` element.\n\n```html\n  \u003cspan class=\"progress\" id=\"p\"\u003e\u003c/span\u003e\n\n  \u003cscript\u003e\n    p.addEventListener('input', e =\u003e {\n      const value = e.value\n      ...\n    })\n  \u003c/script\u003e\n```\n\n## onchange\nThe `onchange` hook function is similiar with `oninput`, which is also simulating the native `change` event, except that you need to change `input` to `change`.\n\n## onerror\nThe `onerror` hook function accept error which InputRange send.\n\n```js\n  slide.onerror = function (err_msg, stacks) {\n    ...\n  }\n```\n\n[example]:./example\n[react_doc]:./docs/react_en.md\n[vue_doc]:./docs/vue_en.md\n\n[init]:#init-1\n[dispatch]:#dispatch\n[prohibit_click]:#prohibit_click\n[prohibit_move]:#prohibit_move\n[oninput]:#oninput-1\n[onchange]:#onchange-1\n[onerror]:#onerror-1\n\n[npm-image]: https://img.shields.io/npm/v/input-range.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/input-range\n[download-image]: https://img.shields.io/npm/dm/input-range.svg?style=flat-square\n[download-url]: https://npmjs.org/package/input-range\n[license-image]: https://img.shields.io/npm/l/input-range.svg","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtaotao%2Finput-range","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimtaotao%2Finput-range","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtaotao%2Finput-range/lists"}