Skip to content

Add bullets navigation #2

Description

@gabrielbs

Currently this component just works with two navigation functions. Are they arrowRight and arrowLeft props

The main objective of this component is works just with render props to let the markup free for who is using.

I thought in create a new prop with the name withBulletsNavigation (or something like that) that contains a functions for make the navigation work that accept an index argument like goToIndex(index) and the current index of the navigation

I think that makes it possible the creation of a carousel with bullets for navigation

The use would be like this

<ComponentSwiper
...
  withBulletsNavigation={({ goToIndex, currentIndex }) => (
    bullets.map((bullet, index) => (
      <li
        className={ currentIndex === index ? 'active': '' }
        onClick={ goToIndex(index) }>{bullet}</li>
      ))
  )}
...
/>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions