{"id":17598097,"url":"https://github.com/potch/range-num","last_synced_at":"2025-04-13T11:52:06.920Z","repository":{"id":211213868,"uuid":"728497706","full_name":"potch/range-num","owner":"potch","description":"A simple web component that combines a range input and a number input","archived":false,"fork":false,"pushed_at":"2023-12-07T05:10:50.000Z","size":4,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T03:03:24.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/potch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-07T04:12:10.000Z","updated_at":"2024-04-12T11:05:43.000Z","dependencies_parsed_at":"2023-12-07T06:24:24.029Z","dependency_job_id":"09006a6e-ad3e-4fa2-9184-9c5eb3c34e07","html_url":"https://github.com/potch/range-num","commit_stats":null,"previous_names":["potch/range-num"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Frange-num","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Frange-num/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Frange-num/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Frange-num/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potch","download_url":"https://codeload.github.com/potch/range-num/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710438,"owners_count":21149188,"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","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":[],"created_at":"2024-10-22T09:44:26.278Z","updated_at":"2025-04-13T11:52:06.899Z","avatar_url":"https://github.com/potch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RangeNum\n\nA vanilla web component that combines an `\u003cinput type=\"range\"\u003e` and an\n`\u003cinput type=\"number\"\u003e` and keeps their values/attributes in sync.\n\n## Installation\n\n`npm install @potch/range-num`\n\n## Usage\n\n```js\n// provided as an ES Module\nimport RangeNum from \"@potch/range-num\";\nRangeNum.register();\n\n// If you'd like to use a different tag name\nRangeNum.register(\"my-cool-range-num\");\n```\n\n```html\n\u003c!-- in your markup --\u003e\n\u003clabel\u003escore \u003crange-num min=\"0\" max=\"10\" value=\"5\" /\u003e\u003c/label\u003e\n```\n\n```js\nconst el = document.querySelector(\"range-num\");\nel.rangeInput; // the inner input[type=\"range\"]\nel.numInput; // the inner input[type=\"number\"]\n```\n\nRangeNum uses \"light\" Shadow Dom, meaning its internal `\u003cinput\u003e` elements are\nvisible to DOM methods like `document.querySelectorAll('input')`\n\n## Configuration\n\nThe following attributes will be propagated from the `\u003crange-num\u003e` to its\ninputs:\n\n- `disabled`\n  - `disabled` attribute can also be set to `\"number\"`, which will then only apply\n    to the underlying `\u003cinput type=\"number\"\u003e`.\n- `max`\n- `min`\n- `name`\n  - only propagated to the inner `\u003cinput type=\"range\"\u003e`. This is done to ensure\n    only one input with that name appears in `FormData`.\n- `readonly`\n  - applies only to the inner `\u003cinput type=\"number\"\u003e`.\n- `step`\n- `value`\n  - latest `value` is synchronized to both inner inputs as well as the top-level\n    `\u003crange-num\u003e`\n\n## Demo\n\n`npm run demo`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotch%2Frange-num","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotch%2Frange-num","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotch%2Frange-num/lists"}