React Responsive Carousel
made with
React
简介及使用教程
React Responsive Carousel是一个基于React.js响应式轮播,功能强大,轻巧且可完全自定义,用于基于React的APP。
安装
Npm
npm i react-responsive-carousel
Yarn
yarn add react-responsive-carousel
使用
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
import { Carousel } from 'react-responsive-carousel';
class DemoCarousel extends Component {
render() {
return (
<Carousel>
<div>
<img src="assets/1.jpeg" />
<p className="legend">Legend 1</p>
</div>
<div>
<img src="assets/2.jpeg" />
<p className="legend">Legend 2</p>
</div>
<div>
<img src="assets/3.jpeg" />
<p className="legend">Legend 3</p>
</div>
</Carousel>
);
}
});
ReactDOM.render(<DemoCarousel />, document.querySelector('.demo-carousel'));
示例
作者
Leandro Lemos
相关项目
没有更多信息
我要推荐一个