Touch and drag slider carousel component for React
Touch and drag slider carousel component for React
Touch and drag slider carousel component for React
npm i react-touch-drag-slider…| Prop | Type | Default | Description |
|---|---|---|---|
| onSlideComplete | (completedIndex: number) => void | A function that gets called when finished | |
| onSlideStart | (startIndex: number) => void | A function that gets called on start | |
| activeIndex | number | 0 | Set to start on this index or use state to update the current index |
| threshold | number | 100 | A pixel value that must be dragged before slide snaps to position |
| transition | number | 0.3 | The CSS snap duration in seconds (ignored when spring is enabled) |
| scaleOnDrag | boolean | false | Should the individual slide scale while dragging |
| navigateOnArrowKeys | boolean | true | Whether arrow keys navigate while the slider is focused |
| spring | boolean | false | Settle with spring physics instead of a CSS transition |
| stiffness | number | 180 | Spring stiffness (used when spring is enabled) |
| damping | number | 16 | Spring damping (used when spring is enabled) |
| mass | number | 1 | Spring mass (used when spring is enabled) |
Full documentation, prop reference, and live demos are on the docs site:
For agents and RAG pipelines, a machine-readable summary is available at
https://react-touch-drag-slider.netlify.app/llms.txt (spec v2 index) and
https://react-touch-drag-slider.netlify.app/llms-full.txt (all content
inlined).
For example of use in a full screen modal with a gallery, please checkout any of the galleries in Bushblade Knives
MIT © bushblade
No open issues yet, or sync has not completed.