Slider

🎵 Slidin' my way downtown 🎵

We use Embla-Carousel to help create our Slider component. Their excellent hooks and customization options make for a wonderful DX.

This component works right out of the box, thanks to a bunch of functionality hidden away in our custom useCarousel hook. You will rarely, if ever, need to edit that file but we recommend familiarizing yourself with the various functions anyways.

We've taken great care to make this component fully customizable so we strongly recommend that you never edit this file directly.

Rather, import it into a new file and customize from there using the following props:

  1. Slides - you can pass an array of components (typically a card) to populate the slides. Common use cases are Testimonials, Partners and Team Members. You also have the option to pass children directly.

  2. Config - want to enable looping, auto-height or change the slider speed? Pass that object of values here.

  3. CSS - Any CSS passed here will apply to the main Slider component itself, but you can specifically target theslides or slide CSS by passing in those keys with their own object of styles:

const SliderCss = {
maxWidth: '90%',
slides: {
justifyContent: 'flex-end',
},
slide: {
f: '0 0 25%',
},
};
  1. Pagination - Defaults to false. If true, we get nice little pagination dots that indicate what slide you're on. You can customize this further in SlidePagination.js.

  2. Navigation - Defaults to true. This renders clickable slider arrows. Further customization can be done in SliderNav.js.

💡
See something that is out of date or that could be improved?Please let the team know!1. You can create a Github issue2. Pull down the repo and create a PR with your suggested changes implimented.3. Or just let someone know in the R&P Slack Channel.We love making things better.