Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
Add line break between buttons generated in react loop

I a trying to add a line break after a button that is generated in a react loop. I've tried adding elements but that has not worked:

<div className="connect-container"> 
  <div>
  {connectors.map((connector) => (
    <button className="metamask-button"
      disabled={!connector.ready}
      key={connector.id}
      onClick={() => connect(connector)}
    >
      {connector.name}
      {!connector.ready && ' (unsupported)'}
      {isConnecting &&
        connector.id === pendingConnector?.id &&
        ' > > >'}
    </button> 
  )) }  
</div>

There should be a space between the buttons. Currently they are stacked without spacing.enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can do this by using following CSS

.connect-container button {
   display: block;
   width: 100%;
   float: none;
}

Another simple & easy way using flex-box.

.connect-container>div{
   display: flex;
   flex-direction: column
}

Code example

.connect-container button {
  display: block;
  width: 100%;
  float: none;
}
<div class="connect-container"> 
  <div>
 
    <button className="metamask-button" > Button 1 </button> 
    
    <button className="metamask-button" > Button 2 </button> 

</div>

Example 2:

.connect-container>div{
       display: flex;
       flex-direction: column;
    } 
    
<div class="connect-container"> 
  <div>
 
    <button className="metamask-button" > Button 1 </button> 
    
    <button className="metamask-button" > Button 2 </button> 

</div>

about 4 years ago · Juan Pablo Isaza Report

0

This approach worked, but only by adding margin-bottom:

.connect-container button {
  display: block;
  width: 100%;
  float: none;
  margin-bottom: 10px;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!