title: How do i add next and previous buttons to my react slideshow website
body: <p><a href="https://i.stack.imgur.com/o228V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o228V.png" alt="The previous and next buttons i want" /></a></p>
  <p>This is an image slider using react. How do i add these previous and next buttons to it.? i have already added the dot navigation but i am not able to add the buttons . Can someone please write me the code for the buttons?</p>
  <p>This is my code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import {SliderContainer} from './sliderElements';
  import './sliderEle.css';
  
  import img1 from '../../images/slider1.png';
  import img2 from '../../images/slider2.png';
  import img3 from '../../images/slider3.png';
  import img4 from '../../images/slider4.png';
  import img5 from '../../images/slider5.png';
  
  const Slider = () =&gt; {
      
      return (
          &lt;&gt;
      &lt;SliderContainer&gt;
        &lt;ul className="slides"&gt;
          &lt;input type="radio" name="radio-btn" id="img-1" checked /&gt;
          &lt;li className="slide-container"&gt;
            &lt;div className="slide"&gt;
              &lt;h1 className="title"&gt;Welcome to Minter!&lt;/h1&gt;
              &lt;p className="para"&gt;Minter is the dApp for OKS holders. If you've never used Minter before, read through our quick introduction first.&lt;/p&gt;
              &lt;img src={img1} alt="" height="198.45px" width="540.15px" /&gt;
            &lt;/div&gt;
        
            &lt;div className="nav"&gt;
              &lt;label for="img-5" className="prev"&gt;&lt;/label&gt;
              &lt;label for="img-2" className="next"&gt;&lt;/label&gt;
            &lt;/div&gt;
          &lt;/li&gt;
  
          &lt;input type="radio" name="radio-btn" id="img-2" /&gt;
          &lt;li className="slide-container"&gt;
            &lt;div className="slide"&gt;
            &lt;h1 className="title"&gt;What is Oikos?&lt;/h1&gt;
              &lt;p className="para"&gt;Oikos is a decentralised synthetic asset issuance protocol built on Binance Smart Chain. These synthetic assets (Synths) are created by staking the Oikos Network Token (OKS), and these Synths can be exchanged for each other directly with the Oikos smart contracts on Oikos.Exchange.&lt;/p&gt;
              &lt;img src={img2} alt="" height="198.45px" width="540.15px" /&gt;
            &lt;/div&gt;
            &lt;div className="nav"&gt;
              &lt;label for="img-1" className="prev"&gt;&lt;/label&gt;
              &lt;label for="img-3" className="next"&gt;&lt;/label&gt;
            &lt;/div&gt;
          &lt;/li&gt;
  
          &lt;input type="radio" name="radio-btn" id="img-3" /&gt;
            &lt;li className="slide-container"&gt;
              &lt;div className="slide"&gt;
                &lt;h1 className="title"&gt;Why stake OKS?&lt;/h1&gt;
                &lt;p className="para"&gt;OKS stakers receive two kinds of rewards. Firstly, they receive OKS staking rewards, which are created through the inflationary monetary policy. Secondly, there’s Synth exchange rewards, which are generated by Synth trades on Oikos.Exchange.&lt;/p&gt;
                &lt;img src={img3}  alt="" height="198.45px" width="540.15px"/&gt;
              &lt;/div&gt;
              &lt;div className="nav"&gt;
                &lt;label for="img-2" className="prev"&gt;&lt;/label&gt;
                &lt;label for="img-4" className="next"&gt;&lt;/label&gt;
              &lt;/div&gt;
            &lt;/li&gt;
  
            &lt;input type="radio" name="radio-btn" id="img-4" checked /&gt;
              &lt;li className="slide-container"&gt;
              &lt;div className="slide"&gt;
                  &lt;h1 className="title"&gt;What do OKS stakers need to do?&lt;/h1&gt;
                  &lt;p className="para"&gt;All Synths need to be backed by staked OKS at a Collateralisation Ratio of 750%. OKS stakers need to manage their own ratio to be above this figure, which they can do by burning Synths to increase their ratio or minting Synths to reduce it. If they do this, they can collect weekly rewards.&lt;/p&gt;
                  &lt;img src={img4} alt="" height="198.45px" width="540.15px" /&gt;
               &lt;/div&gt;
        
              &lt;div className="nav"&gt;
              &lt;label for="img-3" className="prev"&gt;&lt;/label&gt;
              &lt;label for="img-5" className="next"&gt;&lt;/label&gt;
              &lt;/div&gt;
              &lt;/li&gt;
  
          &lt;input type="radio" name="radio-btn" id="img-5" checked /&gt;
              &lt;li className="slide-container"&gt;
              &lt;div className="slide"&gt;
                &lt;h1 className="title"&gt;What are the risks?&lt;/h1&gt;
                &lt;p className="para"&gt;All OKS stakers create a ‘debt’ when they stake. Their debt begins as the amount of oUSD they initially mint, and fluctuates according to gains or losses made by other Synth holders. Any time anyone holds a Synth that appreciates in value, that gain is distributed proportionally between all the staked OKS holders’ debts. A staker must pay off their debt before they can unlock their staked OKS.&lt;/p&gt;
                  &lt;img src={img5} alt="" height="198.45px" width="540.15px" /&gt;
               &lt;/div&gt;
        
            &lt;div className="nav"&gt;
              &lt;label for="img-4" className="prev"&gt;&lt;/label&gt;
              &lt;label for="img-1" className="next"&gt;&lt;/label&gt;
            &lt;/div&gt;
          &lt;/li&gt;
  
            &lt;li className="nav-dots"&gt;
              &lt;label for="img-1" className="nav-dot" id="img-dot-1"&gt;&lt;/label&gt;
              &lt;label for="img-2" className="nav-dot" id="img-dot-2"&gt;&lt;/label&gt;
              &lt;label for="img-3" className="nav-dot" id="img-dot-3"&gt;&lt;/label&gt;
              &lt;label for="img-4" className="nav-dot" id="img-dot-4"&gt;&lt;/label&gt;
              &lt;label for="img-5" className="nav-dot" id="img-dot-5"&gt;&lt;/label&gt;
            &lt;/li&gt;
            &lt;div&gt;
              &lt;label for ="prev" className="prev"&gt;Previous&lt;/label&gt;
              &lt;label for ="next" className="next"&gt;Next&lt;/label&gt;
            &lt;/div&gt;
        &lt;/ul&gt;
        
      &lt;/SliderContainer&gt;
      &lt;/&gt;
  
      )
  }
  
  export default Slider;</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.slides {
      padding: 0;
      width: 700px;
      height: 500px;
      display: block;
      margin: 0 auto;
      position: relative;
  }
  
  .slides * {
      user-select: none;
      -ms-user-select: none;
      -moz-user-select: none;
      -khtml-user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
  }
  
  .slides input {
      display: none;
  }
  
  .slide-container {
      display: block;
  }
  
  .slide {
      top: 0;
      opacity: 0;
      width: 700px;
      height: 500px;
      display: block;
      position: absolute;
      /*transform: scale(0);*/
      transform: translate(1, 0);
      transition: all .7s ease-in-out;
  }
  
  .slide img {
      margin-left: 10%;
      margin-top: 20px;
      text-align: center;
      display: block;
      position: absolute;
  }
  
  .title {
      text-align: center;
      color: rgb(252, 249, 249);
      font-size: 32px;
  }
  
  .para {
      font-size: 20px;
      text-align: center;
      color: #9594ae;
  }
  
  .nav label {
      width: 40px;
      /*height: 60px;*/
      height: 100%;
      display: none;
      position: absolute;
      /*margin: auto;*/
      opacity: 0;
      z-index: 9;
      cursor: pointer;
      transition: opacity .2s;
      color: #FFF;
      font-size: 40pt;
      text-align: center;
      line-height: 380px;
      font-family: "Arial", sans-serif;
      background-color: rgba(255, 255, 255, 0);
      text-shadow: 0px 0px 15px rgb(119, 119, 119);
  }
  
  .slide:hover+.nav label {
      opacity: 0.5;
  }
  
  .nav label:hover {
      opacity: 1;
  }
  
  input:checked+.slide-container .slide {
      opacity: 1;
      /*transform: scale(1);*/
      /*transform: translate();*/
      /*transform: scale(2,3);*/
      transition: opacity 1s ease-in-out;
  }
  
  input:checked+.slide-container .nav label {
      display: block;
  }
  
  .nav-dots {
      width: 100%;
      bottom: 5px;
      height: 5px;
      display: block;
      position: absolute;
      text-align: center;
  }
  
  .nav-dots .nav-dot {
      top: -5px;
      width: 11px;
      height: 11px;
      margin: 0 7px;
      position: relative;
      border-radius: 100%;
      display: inline-block;
      background-color: #FFF;
  }
  
  .nav-dots .nav-dot:hover {
      cursor: pointer;
      background-color: #FFF;
  }
  
  input#img-1:checked~.nav-dots label#img-dot-1,
  input#img-2:checked~.nav-dots label#img-dot-2,
  input#img-3:checked~.nav-dots label#img-dot-3,
  input#img-4:checked~.nav-dots label#img-dot-4,
  input#img-5:checked~.nav-dots label#img-dot-5 {
      background: #727cff;
  }</code></pre>
  </div>
  </div>
  </p>
  <p>How do i add these buttons? I have searched it everywhere but i shows using an array But that is not possible. can someone please help me with the code for that?</p>