You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* passing through events on Slider Component
A goal of the project is to pass through all props when possible. We forgot to pass through event handlers on the slider component.
* updated packages to silence rollup warnings
Needed to update some rollup plugins after recent update to rollup. These plugins were using deprecated rollup hooks.
* passing through props to slider Tray tag
There was a request to pass through props to the Tray tag in slider.
* Update Slider.jsx (#146)
4. Put a CarouselProvider component in your code. This allows the other carousel components to communicate with each other. The only required properties are the orientation, naturalSlideWidth, and naturalSlideHeight. The naturalSlideWidth and naturalSlideHeight are used to create an aspect ratio for each slide. Since the carousel is responsive by default, it will stretch to fill in the width of it's parent container. The CarouselProvider must also have children. We'll add the children in the next step.
73
73
@@ -129,7 +129,7 @@ Let's make a simple carousel with three slides, a next button, and a back button
129
129
naturalSlideWidth={100}
130
130
naturalSlideHeight={125}
131
131
totalSlides={3}
132
-
>
132
+
>
133
133
<Slider>
134
134
<Slide index={0}>I am the first Slide.</Slide>
135
135
<Slide index={1}>I am the second Slide.</Slide>
@@ -144,9 +144,9 @@ Let's make a simple carousel with three slides, a next button, and a back button
144
144
```
145
145
146
146
147
-
That's it. You have a super basic Carousel.
147
+
That's it. You have a super basic Carousel.
148
148
149
-
There are other components you can add, like ButtonFirst, ButtonLast, an Image component, and even an ImageWithZoom component that zooms on mouse hover or finger tap.
149
+
There are other components you can add, like ButtonFirst, ButtonLast, an Image component, and even an ImageWithZoom component that zooms on mouse hover or finger tap.
150
150
151
151
Obviously, you can customize the heck out of the layout. If you need to bury your Slider component in 18 parent divs, go for it. It will still do it's job. Feel free to add the className property to any of the Components to further customize your carousel. Or, hook into the many BEM named default CSS class names built into the carousel components.
152
152
@@ -215,6 +215,7 @@ A Slider is a viewport that masks slides. The Slider component must wrap one or
215
215
| onMasterSpinner |[function|null]| null | No | Optional callback function that is called when the Master Spinner is visible. Requires that <CarouselProvider /> set hasMasterSpinner to true |
216
216
| spinner | function | null | No | Optional inline JSX (aka "render props") to render your own custom spinner. Example `() => <MyCustomSpinnerComponent />` If left blank, the default spinner is used. |
217
217
| style | object | {} | No | Optional css styles to add to the Slider. Note: internal css properties take precedence over any styles specified in the styles object |
218
+
| trayProps | object | {} | No | Any props you want to attach to the slider tray with the exception of className and style. The className prop is handled via classNameTray prop above. Style is used internally. Any event handlers like onMouseDown or others are called after any of our internal event handlers. |
218
219
| trayTag | string | 'ul' | No | The HTML tag to used for the tray (the thing that holds all the slides and moves the slides back and forth.) |
219
220
220
221
#### The Slider component creates the following pseudo HTML by default.
@@ -428,7 +429,7 @@ Use this HOC to pass CarouselProvider state properties as props to a component.
0 commit comments