Bootstrap tab for buttons?

MrWeb picture MrWeb · Jul 22, 2016 · Viewed 12.5k times · Source

I have a sign up page divided into two sections. I just want to show each section content hiding in current page when someone click these major buttons. The concept is similar to bootstrap tabs, but I'm not using tabs here. These are simple bootstrap buttons. I tried to play with bootstrap classes with my code but got no luck. I'm using meteor and react. Screenshot for the image.

"Work and Hire Buttons"

And this is my code

<div id="signup-top-btn">
    <div id="myTabs" role="tablist">
      <div className="col-xs-6 signup-work-btn">
        <button type="button" className="btn btn-block blue-btn active-btn"
          data-toggle="tab"
        >
          Work
        </button>
      </div>
      <div className="col-xs-6 signup-hire-btn">
        <button type="button" className="btn btn-primary btn-block blue-btn"
          data-toggle="tab" data-target="#employer-signup"
        >
          Hire
        </button>
      </div>
    </div>
  </div>

Any idea?

Answer

Luuk Skeur picture Luuk Skeur · Jul 22, 2016

Make use of the Bootstrap tabs, and style those like:

<!-- Nav tabs -->
  <ul class="nav" role="tablist">
    <li role="presentation" class="active"><a href="#work" role="tab" class="btn btn-block blue-btn active-btn" data-toggle="tab">Work</a></li>
    <li role="presentation"><a href="#hire" class="btn btn-primary btn-block blue-btn" role="tab" data-toggle="tab">Hire</a></li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="work">...my working tab</div>
    <div role="tabpanel" class="tab-pane" id="hire">...my hiring tab</div>
  </div>

Bootply: http://www.bootply.com/CrAGi1Btxj