react-snaplist-carousel - npm explorer



);
`

Response

- isDragging: {boolean}.
- disable: A function
() => void to disable the dragToScroll feature.
- enable: A function
() => void to enable the dragToScroll feature.

Arguments

- ref: { React.RefObject\ } \*
-
disable: { booleal }. Optional (default false). The hook will be auto-disabled on touch devices but you can force it using this option.

\* _Required fields_

$3

This an internal util function used by useDragToScroll that can be useful for you. You can use it to modify your UI depending on the device. For example, you can show next/previous arrows only on no touch devices.

Do you want to contribute?

- You can give a star to the project to help with the reputation
- You can share it with your colleagues.
- You can fork the repository and make your PR contribution.
- You can explore using IntersectionObserver for the useVisible hook.
- You can explore with better scrollTo polyfills.
- You can create usefull extra elements like Dots, Thumbnails, Progress or Arrows.
- You can create a new demo example, sky is the limit!
- Yes, you can.

Changelog

$3

- Fix decimal pixel problems
- Breakchange useDragToScroll is returning
{ isDragging } instead of the boolean. https://github.com/luispuig/react-snaplist-carousel/commit/a2d23d6b804dcab1da9520db8edc746c6837f23e#diff-e3457effa5fa347d185fdd0d08ba3209R173
- Version
4.1.0. Fix support for macOS Big Sur
- Version
4.2.0. Add useScroll / goTo / animationEnabled option. Usefull to scroll on component mount.
- Version
4.3.0.
- Removed
event.preventDefault() form mouseDown so focus event can be propagated up in the DOM tree.
-
now accept all the HTMLDivElement properties.
- New className attached so it is easier to target it through CSS:
-
has a .snaplist.
-
has a .snapitem.
- Version
4.4.0. Added rtl support to the useScroll hook. Thanks to @dmvakh
- Version
4.5.0`. Added rtl support to the useScroll hook. Thanks to @equinusocio

$3

- Added useDragToScroll
- Added util isTouchDevice
- Improved useScroll. Now uses the scrollPading to calculate the position of the elements.
- Breakchange the SnapItem elements now uses margin in favor of padding. The browser native behavior works better works better.

License

MIT © luispuig