Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
string
"a user friendly label for screen readers"
If specified, Carousel will be a controlled component. This means that future slide changes will not work unless you subscribe to onChild function and update activeChild accordingly.
number
1
How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
string
"start"
"center"
"end"
"stretch"
"baseline"
Array of child nodes to use for slides of the Carousel.
array
<Box>Slide One</Box> <Box>Slide Two</Box> <Box>Slide Three</Box>
Whether to show carousel controls and which type of controls.
boolean
true
false
string
"arrows"
"selectors"
Whether to expand to fill all of the available width and height in the parent container.
boolean
true
false
A fixed height.
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"any CSS size"
object
{ min: "...", max: "..." }
The amount of margin around the component.
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
Can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
If specified, this function will be called with the active index when the currently active carousel changes. Helpful when using Carousel as a controlled component.
function
() => {}
If specified, the number of milliseconds between automatically transitioning to the next child. It will loop through all children indefinitely.
number
1500
A fixed width.
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"any CSS size"
object
{ min: "...", max: "..." }
At its core, the Carousel component is a regular <div> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for div elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The icon to use for the previous image navigation control.
element
<Previous />
The icon to use on the middle navigation control. One icon per carousel image.
element
<Next />
The color used for Carousel icons.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The color used for disabled Carousel icons.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The color of a given icon.
string
A hex, name, or rgb value.
"black"
object
An object with a color for dark and light modes.
{ dark: #f8f8f8, light: #666666 }