{"id":15292552,"url":"https://github.com/sanderdebr/react-draggable-slider","last_synced_at":"2025-04-13T11:12:24.425Z","repository":{"id":41624550,"uuid":"270274468","full_name":"sanderdebr/react-draggable-slider","owner":"sanderdebr","description":"NPM package for my custom Draggable React Slider using React Spring and GSAP.","archived":false,"fork":false,"pushed_at":"2023-01-06T08:11:46.000Z","size":2449,"stargazers_count":15,"open_issues_count":22,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T11:12:16.151Z","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/sanderdebr.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}},"created_at":"2020-06-07T10:46:19.000Z","updated_at":"2024-12-30T07:33:15.000Z","dependencies_parsed_at":"2023-02-05T16:46:23.004Z","dependency_job_id":null,"html_url":"https://github.com/sanderdebr/react-draggable-slider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdebr%2Freact-draggable-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdebr%2Freact-draggable-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdebr%2Freact-draggable-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdebr%2Freact-draggable-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanderdebr","download_url":"https://codeload.github.com/sanderdebr/react-draggable-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"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-09-30T16:18:45.514Z","updated_at":"2025-04-13T11:12:24.402Z","avatar_url":"https://github.com/sanderdebr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-draggable-slider\n\n![GitHub](https://img.shields.io/github/license/dbismut/react-soft-slider) \n[![NPM Downloads](https://img.shields.io/npm/dt/react-draggable-slider?style=flat)]()  \n\n\u003cp align=\"left\"\u003eNPM package for my custom Draggable React Slider using React Spring and GSAP.\u003c/p\u003e\n\n![gif](https://media.giphy.com/media/gKNT6B5MkMnp4sHMiT/giphy.gif) \n![gif-mobile](https://media.giphy.com/media/jmwmKtZR553jULsnCR/giphy.gif)\n\n## Installation\n\n```\nnpm install react-draggable-slider --save-dev\n```\n\n### Demo\n\nhttps://sanderdebr.github.io/react-draggable-slider/\n\n[![Edit agitated-christian-rlg5j](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/agitated-christian-rlg5j?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n## Usage\n\nAdd `\u003cSlider /\u003e` component with sliderSettings object, the only required setting an array of slider items.\n\n```jsx\nimport { Slider } from \"react-draggable-slider\";\nimport { projectList } from \"./data\";\n\nfunction App() {\n  const sliderSettings = {\n    data: projectList,\n    speed: 3000,\n    easing: \"elastic\",\n    bgColor: \"rgba(255, 255, 255, 0.05)\",\n    buttonHref: \"https://www.google.com\",\n    buttonTarget: \"_self\",\n    buttonText: \"View project\",\n    showButton: true,\n  };\n  return \u003cSlider sliderSettings={sliderSettings} /\u003e;\n}\n```\n\nUse the following structure for your slider items:\n\n```javascript\nexport const projectList = [\n  {\n    title: \"Cutting Edge Project\",\n    image: \"https://source.unsplash.com/collection/347317/\",\n    description: \"Praesent quis congue nisi...\",\n  },\n  {\n    title: \"Featured Artist 3D\",\n    image: \"https://source.unsplash.com/collection/3573299/\",\n    description: \"Duis at tellus vitae velit aliquet varius...\",\n  },\n];\n```\n\n\u003e **Note:** although the above example uses hooks, react-draggable-slider is compatible with Class-based components. However, since it internally uses hooks, it requires React `16.8+`.\n\n### Props\n\nThe sliderSettings prop in `\u003cSlider sliderSettings={sliderSettings} /\u003e` component accepts the following props:\n\n| Name         | Type      | Description                                                                          | Default Value               |\n| ------------ | --------- | ------------------------------------------------------------------------------------ | --------------------------- |\n| `data`       | `array`   | array of slider items, see below which structure you may use                         | `[]`                        |\n| `speed`      | `number`  | speed of sliding to next item when dragged in milliseconds                           | 3000 (3 seconds)            |\n| `easing`     | `string`  | 4 available GSAP easings to animate the sliding: \"power\", \"back\", \"elastic\", \"expo\". | ease                        |\n| `bgColor`    | `string`  | Set background-color of the whole slider, accepts HEX and RGB(A).                    | `rgba(255, 255, 255, 0.05)` |\n| `buttonText` | `string`  | Text inside button per item                                                          | `View case study`           |\n| `showButton` | `boolean` | If a button should be shown for all items                                            | `true`                      |\n\n### Using\n\n- React Spring\n- GSAP\n- Styled Components\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderdebr%2Freact-draggable-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanderdebr%2Freact-draggable-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderdebr%2Freact-draggable-slider/lists"}