Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.03 KB

carousel.mdx

File metadata and controls

68 lines (50 loc) · 2.03 KB

import { graphql } from 'gatsby';

import ComponentApi from '../../components/ComponentApi'; import ReactPlayground from '../../components/ReactPlayground'; import CarouselControlled from '../../examples/Carousel/Controlled'; import CarouselUncontrolled from '../../examples/Carousel/Uncontrolled'; import CarouselFade from '../../examples/Carousel/CarouselFade'; import IndividualIntervals from '../../examples/Carousel/IndividualIntervals';

Carousels

A slideshow component for cycling through elements—images or slides of text—like a carousel.

Example

Carousels don’t automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they’re not explicitly required. Add and customize as you see fit.

Controlled

You can also control the Carousel state, via the activeIndex prop and onSelect handler.

Crossfade

Add the fade prop to your carousel to animate slides with a fade transition instead of a slide.

Individual Item Intervals

You can specify individual intervals for each carousel item via the interval prop.

API

export const query = graphqlquery CarouselQuery { carousel: componentMetadata(displayName: { eq: "Carousel" }) { displayName ...ComponentApi_metadata } item: componentMetadata(displayName: { eq: "CarouselItem" }) { displayName ...ComponentApi_metadata } caption: componentMetadata(displayName: { eq: "CarouselCaption" }) { displayName ...ComponentApi_metadata } };