Skip to content

Update vertical tabs nav example #25706

Description

@kwasimensah

The example code for navs using vertical tabs (https://getbootstrap.com/docs/4.0/components/navs/#javascript-behavior) leaves out that it internally creates a row and puts the links in one column and the tab content in another. You have to inspect the code of the bootstrap documentation to see how it it actually works on that page.

It should really look similar to:

<div class="bd-example bd-example-tabs">
  <div class="row">
    <div class="col-3">
      <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
        <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</a>
        <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</a>
        <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</a>
        <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</a>
      </div>
    </div>
    <div class="col-9">
      <div class="tab-content" id="v-pills-tabContent">
        <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">...</div>
        <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">...</div>
        <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">...</div>
        <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">...</div>
      </div>
    </div>
  </div>
</div>

Activity

  1. BrainFeeder commented on Mar 5, 2018

    @BrainFeeder

    +1

    And styles for vertical .nav-tabs seem to be missing? Unless they are not supported...

  2. gbjbaanb commented on Mar 9, 2018

    @gbjbaanb

    these are not really vertical tabs, but vertical pills. The difference is that tabs would be right-aligned with a right-hand border. (which you don't get, so technically there is no such thing as vertical tabs at all)

  3. added a commit that references this issue on Mar 15, 2018
    bca3ecf
  4. deleted a comment from kwasimensah on Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions