react.js antd carousel with arrows

后端 未结 7 2250
既然无缘
既然无缘 2021-01-12 11:26

I am looking at using the antd Caroseul, but I\'ve not seen an example that creates a prev/next or pause button.

const { Carousel } = antd;

ReactDOM.render         


        
7条回答
  •  渐次进展
    2021-01-12 11:37

    If you want to add arrows, you can use the arrow icons provided by Antd

    } prevArrow={}>
    
    

    Since the arrows are hidden by Antd css, you can override it in your own css with the following:

    .ant-carousel .slick-prev,
    .ant-carousel .slick-next {
      color: unset;
      font-size: unset;
    }
    
    .ant-carousel .slick-prev:hover,
    .ant-carousel .slick-next:hover,
    .ant-carousel .slick-prev:focus,
    .ant-carousel .slick-next:focus {
      color: unset;
    }
    
    

提交回复
热议问题