Member-only story
How to create a React Bootstrap carousel for landing pages
You may have encountered a situation where you need to add a carousel to the landing pages. A carousel is a slide show of images or videos or a combination of both images and videos in a cyclic manner. You can create a carousel from scratch with HTML, CSS, and JavaScript. However, if you use a CSS framework such as React Bootstrap, you can cut down a significant amount of development time. In this post, I will show you how to use React Bootstrap to create a carousel with video and images for a landing page. You can use a carousel in the background, but I am going to use this carousel in the foreground in this post.
Setting up the project with create-react-app
- Create a React app:
npx create-react-app demo-slide-show
- Create a folder named
assets
insrc
folder - Add two images and one video clip ( if you do not want to use YouTube video ) to this folder. You can add your own images or download them from the resources section with full code.
Install React Bootstrap
- Install React Bootstrap:
npm install react-bootstrap bootstrap
- Add the following scripts to
public/index.html
. You need these script tags for Bootstrap to work