0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-02 14:24:19 +01:00
Bootstrap/docs/_includes/components/navs.html

236 lines
7.7 KiB
HTML
Raw Normal View History

2014-03-17 03:03:53 +01:00
<div class="bs-docs-section">
<h1 id="nav" class="page-header">Navs</h1>
<p class="lead">Navigation available in Bootstrap share general markup and styles, from the base <code>.nav</code> class to the active and disabled states. Swap modifier classes to switch between each style.</p>
2014-03-17 03:03:53 +01:00
<h2 id="nav-base">Base nav</h2>
<p>Roll your own navigation style by extending the base <code>.nav</code> component. All Bootstrap's nav components are built on top of this. Includes styles for the disabled state, but <strong>not the active state</strong>.</p>
{% example html %}
<ul class="nav" role="tablist">
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item disabled">
<a class="nav-link" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
<p>Classes are used so your markup can be super flexible.</p>
<div class="bs-example">
<nav class="nav" role="tablist">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Another link</a>
<a class="nav-link disabled" href="#">Disabled</a>
</nav>
</div>
{% highlight html %}
<nav class="nav" role="tablist">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Another link</a>
<a class="nav-link disabled" href="#">Disabled</a>
</nav>
{% endhighlight %}
2014-07-09 22:51:20 +02:00
2014-03-17 03:03:53 +01:00
<h2 id="nav-tabs">Tabs</h2>
<p>Takes the basic nav from above and adds the <code>.nav-tabs</code> class to generate a tabbed interface.</p>
2014-03-17 03:03:53 +01:00
<div class="bs-example">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
</div>
{% highlight html %}
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
{% endhighlight %}
<div class="bs-callout bs-callout-info">
<h4>Requires JavaScript tabs plugin</h4>
<p>For tabs with tabbable areas, you must use the <a href="../javascript/#tabs">tabs JavaScript plugin</a>.</p>
</div>
<h2 id="nav-pills">Pills</h2>
<p>Take that same HTML, but use <code>.nav-pills</code> instead:</p>
<div class="bs-example">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
</div>
{% highlight html %}
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
{% endhighlight %}
<h2 id="nav-pills-stacked">Stacked pills</h2>
<p>Just add <code>.nav-stacked</code>.</p>
2014-03-17 03:03:53 +01:00
<div class="bs-example">
<ul class="nav nav-pills nav-stacked" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
</div>
{% highlight html %}
<ul class="nav nav-pills nav-stacked" role="tablist">
<li role="presentation" class="nav-item active">
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Link</a>
</li>
<li role="presentation" class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
{% endhighlight %}
<h2 id="nav-dropdowns">Using dropdowns</h2>
<p>Add dropdown menus with a little extra HTML and the <a href="../javascript/#dropdowns">dropdowns JavaScript plugin</a>.</p>
<h3>Tabs with dropdowns</h3>
<div class="bs-example">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item active">
2014-07-10 01:08:18 +02:00
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
2014-07-10 01:08:18 +02:00
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Dropdown</a>
2014-03-17 03:03:53 +01:00
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
<li role="presentation" class="nav-item">
2014-07-10 01:08:18 +02:00
<a href="#" class="nav-link">Another link</a>
</li>
<li role="presentation" class="nav-item disabled">
2014-07-10 01:08:18 +02:00
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
</div>
{% highlight html %}
<ul class="nav nav-tabs" role="tablist">
2014-03-17 03:03:53 +01:00
...
<li role="presentation" class="nav-item">
2014-07-10 01:08:18 +02:00
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
2014-03-17 03:03:53 +01:00
</a>
<ul class="dropdown-menu" role="menu">
2014-03-17 03:03:53 +01:00
...
</ul>
</li>
...
</ul>
{% endhighlight %}
<h3>Pills with dropdowns</h3>
<div class="bs-example">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="nav-item active">
2014-07-10 01:08:18 +02:00
<a href="#" class="nav-link">Active</a>
</li>
<li role="presentation" class="nav-item">
2014-07-10 01:08:18 +02:00
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Dropdown</a>
2014-03-17 03:03:53 +01:00
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
2014-07-10 01:08:18 +02:00
<li class="nav-item">
<a href="#" class="nav-link">Another link</a>
</li>
<li class="nav-item disabled">
<a href="#" class="nav-link">Disabled</a>
</li>
2014-03-17 03:03:53 +01:00
</ul>
2014-07-10 01:08:18 +02:00
</div>
2014-03-17 03:03:53 +01:00
{% highlight html %}
<ul class="nav nav-pills" role="tablist">
2014-03-17 03:03:53 +01:00
...
<li role="presentation" class="nav-item">
2014-07-10 01:08:18 +02:00
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
2014-03-17 03:03:53 +01:00
</a>
<ul class="dropdown-menu" role="menu">
2014-03-17 03:03:53 +01:00
...
</ul>
</li>
...
</ul>
{% endhighlight %}
</div>