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
// controls if the left and right arrow keys should control the carousel
35
37
keyboard: PropTypes.bool,
36
-
// controls if the carousel should not automatically cycle (default: false)
37
-
paused: PropTypes.bool,
38
-
// the interval at which the carousel automatically cycles (default: 5000)
38
+
/* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
39
+
* mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
40
+
*/
41
+
pause: PropTypes.oneOf(['hover', false]),
42
+
// Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
43
+
// This is how bootstrap defines it... I would prefer a bool named autoplay or something...
44
+
ride: PropTypes.oneOf(['carousel']),
45
+
// the interval at which the carousel automatically cycles (default: 5000)
39
46
interval: PropTypes.oneOfType([
40
47
PropTypes.number,
41
48
PropTypes.string,
42
49
PropTypes.bool,
43
50
]),
44
51
children: PropTypes.array,
45
52
// called when the mouse enters the Carousel
46
-
hoverStart: PropTypes.func,
53
+
mouseEnter: PropTypes.func,
47
54
// called when the mouse exits the Carousel
48
-
hoverEnd: PropTypes.func,
55
+
mouseLeave: PropTypes.func,
49
56
// controls whether the slide animation on the Carousel works or not
50
57
slide: PropTypes.bool,
51
58
cssModule: PropTypes.object,
59
+
};`}
60
+
</PrismCode>
61
+
</pre>
62
+
63
+
<h3>Uncontrolled Carousel</h3>
64
+
<p>
65
+
For the most basic use-case an uncontrolled component can provide the functionality wanted without the need to manage/control the state of the component. <code>UncontrolledCarousel</code> does not require <code>previous</code>, <code>next</code> nor <code>activeIndex</code> props to work.
66
+
Anything provided to a normal <code>Carousel</code> can also be provided to <code>UncontrolledCarousel</code>, overriding the control <code>UncontrolledCarousel</code> provides. Additionally, you can hide the controls by passing <code>false</code> to the <code>controls</code> prop
67
+
and you can disable the indicators by passing <code>false</code> to the <code>indicators</code> prop; both are visible by default. Autoplay (<code>ride="carousel"</code>) is enabled by default, you can disable it by passing <code>false</code> to the <code>autoPlay</code> prop.
68
+
</p>
69
+
<divclassName="docs-example">
70
+
<CarouselUncontrolledExample/>
71
+
</div>
72
+
<pre>
73
+
<PrismCodeclassName="language-jsx">
74
+
{CarouselUncontrolledExampleSource}
75
+
</PrismCode>
76
+
</pre>
77
+
78
+
<h3>Uncontrolled Carousel Properties</h3>
79
+
<p>Same as Carousel (except children) can be overridden plus the following</p>
0 commit comments