Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Improved TypeScript version #8

Description

@mindplay-dk

Hi there,

Thank you for an absolutely brilliant starting point! :-)

I love the simple, elegant approach you took with this - and decided to continue with some changes and features I needed in my own project:

  • Ported to TypeScript.
  • Touch/drag interactions improved and simplified.
  • Virtualized slides: only 4 slides are physically in the DOM at one time, so you effectively get lazy-loading of images, iframes, etc.
  • Seamless loop: the last slide appears to be located before the first.

Note that I also removed some features and all of the options - and added a simple, public API, so that the parent example gallery component can send commands using a ref.

The whole things is still somehow only 200 lines of code ;-)

I'll just post it here for you and others to enjoy:

https://stackblitz.com/edit/react-slider-ttttt

Of course, feel free to use this under MIT, same as how you published it :-)

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions