logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
5.26.0
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0
When To Use
Examples
Basic
Position
Scroll automatically
Fade in
Arrows for switching
Progress of dots
API
Methods
Design Token
FAQ
How to add custom arrows?

Carousel

A set of carousel areas.
Importimport { Carousel } from "antd";
Sourcecomponents/carousel
Docs
Edit this pageChangelog
contributors
  • CardCollapse

    Resources

    Ant Design X
    Ant Design Charts
    Ant Design Pro
    Pro Components
    Ant Design Mobile
    Ant Design Mini
    Ant Design Web3
    Ant Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Ant Design
    Medium
    Twitter
    yuque logoAnt Design in YuQue
    Ant Design in Zhihu
    Experience Cloud Blog
    seeconf logoSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTech logoMore Products

    yuque logoYuQue-Document Collaboration Platform
    AntV logoAntV-Data Visualization
    Egg logoEgg-Enterprise Node.js Framework
    Kitchen logoKitchen-Sketch Toolkit
    Galacean logoGalacean-Interactive Graphics Solution
    xtech logoAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Ant Design Community

    When To Use

    • When there is a group of content on the same level.
    • When there is insufficient content space, it can be used to save space in the form of a revolving door.
    • Commonly used for a group of pictures/cards.

    Examples

    API

    Common props ref:Common props

    PropertyDescriptionTypeDefaultVersion
    arrowsWhether to show switch arrowsbooleanfalse5.17.0
    autoplayWhether to scroll automatically, you can specify autoplay={{ dotDuration: true }} to display the progress barboolean | { dotDuration?: boolean }falsedotDuration: 5.24.0
    autoplaySpeedDelay between each auto scroll (in milliseconds)number3000
    adaptiveHeightAdjust the slide's height automaticallybooleanfalse
    dotPositionThe position of the dots, which can be one of top bottom left rightstringbottom
    dotsWhether to show the dots at the bottom of the gallery, object for dotsClassboolean | { className?: string }true
    draggableEnable scrollable via dragging on desktopbooleanfalse
    fadeWhether to use fade transitionbooleanfalse
    infiniteInfinitely wrap around contentsbooleantrue
    speedAnimation speed in millisecondsnumber500
    easingTransition interpolation function namestringlinear
    effectTransition effectscrollx | fadescrollx
    afterChangeCallback function called after the current index changes(current: number) => void-
    beforeChangeCallback function called before the current index changes(current: number, next: number) => void-
    waitForAnimateWhether to wait for the animation when switchingbooleanfalse

    Find more APIs in react-slick documentation.

    Methods

    NameDescription
    goTo(slideNumber, dontAnimate)Go to slide index, if dontAnimate=true, it happens without animation
    next()Change current slide to next slide
    prev()Change current slide to previous slide

    Design Token

    Component TokenHow to use?
    Token NameDescriptionTypeDefault Value
    arrowOffsetarrows offset to Carousel edgenumber8
    arrowSizeSize of arrowsnumber16
    dotActiveWidthWidth of active indicatorstring | number24
    dotGapgap between indicatornumber4
    dotHeightHeight of indicatorstring | number3
    dotOffsetdot offset to Carousel edgenumber12
    dotWidthWidth of indicatorstring | number16
    Global TokenHow to use?

    FAQ

    How to add custom arrows?

    See #12479.

    Basic

    Basic usage.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Scroll automatically

    Timing of scrolling to the next card/picture.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Arrows for switching

    Show the arrows for switching.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    5.17.0
    Position

    There are 4 position options available.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Fade in

    Slides use fade for transition.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Progress of dots

    Show progress of dots.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    5.24.0

    4

    1

    2

    3

    4

    1

    2

    3

    4

    4

    1

    2

    3

    4

    1

    2

    3

    4

    1

    2

    3

    4


    1

    2

    3

    4

    4

    1

    2

    3

    4

    1

    2

    3

    4

    1

    2

    3

    4

    4

    1

    2

    3

    4

    1

    2

    3

    4