1
   const BeerSlider = () => {
        const settings = {
            className: 'center',
            dots: true,
            infinite: true,
            speed: 500,
            focusOnSelect: true,
            slidesToShow: 3,
            centerMode: true,
            slidesToScroll: 1,
            centerPadding: '230px',
            onInit: () => {
 ```add class prev and next slick slide ```
               
            }
    
        }
Richard Dallaway
  • 4,250
  • 1
  • 28
  • 39
verba
  • 11
  • 3

1 Answers1

1

You can actually replace the next and previous arrow icons come default. I think that would be better than adding styles to existing CSS classes.

1st way

Add more CSS properties for the existing CSS class

.slick-arrow.slick-next {
     // your styles
     ...
     ...
}

.slick-arrow.slick-prev {
     // your styles
     ...
     ...
}

2nd way

Add custom next and previous buttons

const settings = {
    className: "center",
    dots: true,
    infinite: true,
    speed: 500,
    focusOnSelect: true,
    slidesToShow: 3,
    centerMode: true,
    slidesToScroll: 1,
    centerPadding: "230px",
    nextArrow: <RightNavButton />,
    prevArrow: <LeftNavButton />
};

function LeftNavButton(props) {
    const { className, style, onClick } = props;
    return (
        <div
            className="slick-arrow"
            style={{ ...style, display: "block" }}
            onClick={onClick}
        >
            <div className="artilces-slider-left-arrow">
                {/* this is font awesome icons */}
                <i class="fas fa-angle-left"></i> 
            </div>
        </div>
    );
}

function RightNavButton(props) {
    const { className, style, onClick } = props;
    return (
        <div
            className="slick-arrow"
            style={{ ...style, display: "block" }}
            onClick={onClick}
        >
            <div className="artilces-slider-right-arrow">
                {/* this is font awesome icons */}
                <i class="fas fa-angle-right"></i>
            </div>
        </div>
    );
}
Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43