{"id":23727748,"url":"https://github.com/swiftcarrot/react-input-slider","last_synced_at":"2025-04-04T18:08:36.111Z","repository":{"id":29138381,"uuid":"32668426","full_name":"swiftcarrot/react-input-slider","owner":"swiftcarrot","description":"React input slider component","archived":false,"fork":false,"pushed_at":"2024-05-07T06:39:19.000Z","size":2219,"stargazers_count":141,"open_issues_count":16,"forks_count":42,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-23T03:20:56.587Z","etag":null,"topics":["javascript","react","slider"],"latest_commit_sha":null,"homepage":"https://react-input-slider.caitou.org","language":"JavaScript","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/swiftcarrot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-22T08:49:26.000Z","updated_at":"2024-06-18T13:33:01.870Z","dependencies_parsed_at":"2024-06-18T13:32:37.989Z","dependency_job_id":"25a05849-c3cd-47f2-b609-59b05068a5b9","html_url":"https://github.com/swiftcarrot/react-input-slider","commit_stats":{"total_commits":132,"total_committers":8,"mean_commits":16.5,"dds":"0.10606060606060608","last_synced_commit":"a5e44e598370229e34d45553cd5b06b64a7e63c5"},"previous_names":["wangzuo/react-input-slider"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftcarrot%2Freact-input-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftcarrot%2Freact-input-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftcarrot%2Freact-input-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftcarrot%2Freact-input-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftcarrot","download_url":"https://codeload.github.com/swiftcarrot/react-input-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["javascript","react","slider"],"created_at":"2024-12-31T01:29:57.765Z","updated_at":"2025-04-04T18:08:36.091Z","avatar_url":"https://github.com/swiftcarrot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-input-slider\n\n[![npm](https://img.shields.io/npm/v/react-input-slider.svg)](https://www.npmjs.com/package/react-input-slider)\n[![npm](https://img.shields.io/npm/dm/react-input-slider.svg)](https://www.npmjs.com/package/react-input-slider)\n[![Build Status](https://travis-ci.org/swiftcarrot/react-input-slider.svg?branch=master)](https://travis-ci.org/swiftcarrot/react-input-slider)\n[![codecov](https://codecov.io/gh/swiftcarrot/react-input-slider/branch/master/graph/badge.svg)](https://codecov.io/gh/swiftcarrot/react-input-slider)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nReact slider component\n\n### Installation\n\n```sh\nyarn add react-input-slider\nnpm install react-input-slider --save\n```\n\n### Storybook Demo\n\n[http://react-input-slider.caitouyun.com](http://react-input-slider.caitouyun.com)\n\n### Usage\n\n```javascript\nimport React from 'react';\nimport Slider from 'react-input-slider';\n\nfunction App() {\n  const [state, setState] = useState({ x: 10, y: 10 });\n\n  return (\n    \u003cdiv\u003e\n      ({state.x}, {state.y})\n      \u003cSlider axis=\"xy\" x={state.x} y={state.y} onChange={setState} /\u003e\n      \u003cSlider\n        axis=\"x\"\n        x={state.x}\n        onChange={({ x }) =\u003e setState(state =\u003e ({ ...state, x }))}\n      /\u003e\n      \u003cSlider axis=\"y\" y={state.y} onChange={({ y }) =\u003e setState(state =\u003e ({ ...state, y }))} /\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### Styling\n\nv5 introduces a new styling api powered by [emotion](https://emotion.sh/)\n\n```javascript\n\u003cSlider\n  styles={{\n    track: {\n      backgroundColor: 'blue'\n    },\n    active: {\n      backgroundColor: 'red'\n    },\n    thumb: {\n      width: 50,\n      height: 50\n    },\n    disabled: {\n      opacity: 0.5\n    }\n  }}\n/\u003e\n```\n\n### Props\n\n| Name        | Type     | Description                           | Default |\n| ----------- | -------- | ------------------------------------- | ------- |\n| axis        | string   | type of slider (`'x'`, `'y'`, `'xy'`) | `'x'`   |\n| x           | number   | value of x                            | `50`    |\n| xmax        | number   | max of x                              | `100`   |\n| xmin        | number   | min of x                              | `0`     |\n| y           | number   | value of y                            | `50`    |\n| ymax        | number   | max of y                              | `100`   |\n| ymin        | number   | min of y                              | `0`     |\n| xstep       | number   | step of x                             | `1`     |\n| ystep       | number   | step of y                             | `1`     |\n| onChange    | function | handleChange                          | `null`  |\n| onDragStart | function | handleDragStart                       | `null`  |\n| onDragEnd   | function | handleDragEnd                         | `null`  |\n| disabled    | boolean  | input disabled                        | false   |\n| xreverse    | boolean  | reverse on x                          | false   |\n| yreverse    | boolean  | reverse on y                          | false   |\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftcarrot%2Freact-input-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftcarrot%2Freact-input-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftcarrot%2Freact-input-slider/lists"}