I'm using http://react-bootstrap.github.io/ Carousel component. I am trying to customize the carousel-indicators including some texts, and make it look like a button with text, but react render 'ol' tag into a new CarouseItem and no redirect function
return (
<Carousel id="sampleSlide" indicators={false}>
<ol className="carousel-indicators">
<li data-target='#sampleSlide' data-slide-to="0" className="active"></li>
<li data-target= '#sampleSlide' data-slide-to="1"></li>
</ol>
<CarouselItem>
<div className="itemContent">
Hello World
</div>
</CarouselItem>
<CarouselItem>
<div className="itemContent">
Hello World
</div>
</CarouselItem>
</Carousel>
);
Is there any way to customize it or any other method to do so?
You can change your Bootstrap carousel Indicator with customized CSS/SCSS
Reactjs code:
<div className={classes.my__carousel_main}>
<Carousel>
<Carousel.Item>
<img
className="d-block w-100"
src={require("../../assets/utf_banner.png")}
alt="First slide"
/>
<Carousel.Caption>
<h3>First slide label</h3>
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
</Carousel.Caption>
</Carousel.Item>
</Carousel>
</div>
CSS/SCSS code:
.my__carousel_main {
div{
ol{
li{
background-color: red;
border-radius: 50%;
height: 10px;
width: 10px;
}
}
}
}
Thank You ;)
This is how I customized it:
.carousel-indicators li {
border-top: unset;
width: 10px;
border-bottom: unset;
border: 1px solid transparent;
border-left-width: 0;
border-right-width: 0;
border-radius: 10px;
background-color: rgba(169, 29, 42, 0.4);
height: 10px;
width: 20px;}
.carousel-indicators .active {
border-top: unset;
border-bottom: unset;
border: 1px solid transparent;
border-left-width: 0;
border-right-width: 0;
border-radius: 10px;
background-color: #A91D2A;
height: 10px;
width: 50px}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With