2014-03-17 03:03:53 +01:00
< div class = "bs-docs-section" >
< h1 id = "panels" class = "page-header" > Panels< / h1 >
< p class = "lead" > While not always necessary, sometimes you need to put your DOM in a box. For those situations, try the panel component.< / p >
2015-02-24 04:14:50 +01:00
< h2 id = "panels-basic" > Basic example< / h2 >
2014-03-17 03:03:53 +01:00
< p > By default, all the < code > .panel< / code > does is apply some basic border and padding to contain some content.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "simple-panel" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
< div class = "panel-body" >
Basic panel example
< / div >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
< div class = "panel-body" >
Basic panel example
< / div >
< / div >
{% endhighlight %}
2015-02-24 04:14:50 +01:00
< h2 id = "panels-heading" > Panel with heading< / h2 >
2014-03-17 03:03:53 +01:00
< p > Easily add a heading container to your panel with < code > .panel-heading< / code > . You may also include any < code > < h1> < / code > -< code > < h6> < / code > with a < code > .panel-title< / code > class to add a pre-styled heading.< / p >
2014-06-19 07:16:15 +02:00
< p > For proper link coloring, be sure to place links in headings within < code > .panel-title< / code > .< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "panel-with-heading" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
< div class = "panel-heading" > Panel heading without title< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
< div class = "panel-heading" > Panel heading without title< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
{% endhighlight %}
2015-02-24 04:14:50 +01:00
< h2 id = "panels-footer" > Panel with footer< / h2 >
2014-03-17 03:03:53 +01:00
< p > Wrap buttons or secondary text in < code > .panel-footer< / code > . Note that panel footers < strong > do not< / strong > inherit colors and borders when using contextual variations as they are not meant to be in the foreground.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "panel-with-footer" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
< div class = "panel-body" >
Panel content
< / div >
< div class = "panel-footer" > Panel footer< / div >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
< div class = "panel-body" >
Panel content
< / div >
< div class = "panel-footer" > Panel footer< / div >
< / div >
{% endhighlight %}
2015-02-24 04:14:50 +01:00
< h2 id = "panels-alternatives" > Contextual alternatives< / h2 >
2014-03-17 03:03:53 +01:00
< p > Like other components, easily make a panel more meaningful to a particular context by adding any of the contextual state classes.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "contextual-panels" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-primary" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-success" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-info" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-warning" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< div class = "panel panel-danger" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Panel title< / h3 >
< / div >
< div class = "panel-body" >
Panel content
< / div >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-primary" > ...< / div >
< div class = "panel panel-success" > ...< / div >
< div class = "panel panel-info" > ...< / div >
< div class = "panel panel-warning" > ...< / div >
< div class = "panel panel-danger" > ...< / div >
{% endhighlight %}
2015-02-24 04:14:50 +01:00
< h2 id = "panels-tables" > With tables< / h2 >
2014-03-17 03:03:53 +01:00
< p > Add any non-bordered < code > .table< / code > within a panel for a seamless design. If there is a < code > .panel-body< / code > , we add an extra border to the top of the table for separation.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "table-within-panel" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
< div class = "panel-body" >
< p > Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.< / p >
< / div >
<!-- Table -->
< table class = "table" >
< thead >
< tr >
< th > #< / th >
< th > First Name< / th >
< th > Last Name< / th >
< th > Username< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 1< / th >
2014-03-17 03:03:53 +01:00
< td > Mark< / td >
< td > Otto< / td >
< td > @mdo< / td >
< / tr >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 2< / th >
2014-03-17 03:03:53 +01:00
< td > Jacob< / td >
< td > Thornton< / td >
< td > @fat< / td >
< / tr >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 3< / th >
2014-03-17 03:03:53 +01:00
< td > Larry< / td >
< td > the Bird< / td >
< td > @twitter< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
< div class = "panel-body" >
< p > ...< / p >
< / div >
<!-- Table -->
< table class = "table" >
...
< / table >
< / div >
{% endhighlight %}
< p > If there is no panel body, the component moves from panel header to table without interruption.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "panel-without-body-with-table" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
<!-- Table -->
< table class = "table" >
< thead >
< tr >
< th > #< / th >
< th > First Name< / th >
< th > Last Name< / th >
< th > Username< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 1< / th >
2014-03-17 03:03:53 +01:00
< td > Mark< / td >
< td > Otto< / td >
< td > @mdo< / td >
< / tr >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 2< / th >
2014-03-17 03:03:53 +01:00
< td > Jacob< / td >
< td > Thornton< / td >
< td > @fat< / td >
< / tr >
< tr >
2014-11-14 13:37:31 +01:00
< th scope = "row" > 3< / th >
2014-03-17 03:03:53 +01:00
< td > Larry< / td >
< td > the Bird< / td >
< td > @twitter< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
<!-- Table -->
< table class = "table" >
...
< / table >
< / div >
{% endhighlight %}
2015-02-24 04:14:50 +01:00
< h2 id = "panels-list-group" > With list groups< / h2 >
2014-03-17 03:03:53 +01:00
< p > Easily include full-width < a href = "#list-group" > list groups< / a > within any panel.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "panel-with-list-group" >
2014-03-17 03:03:53 +01:00
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
< div class = "panel-body" >
< p > Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.< / p >
< / div >
<!-- List group -->
< ul class = "list-group" >
< li class = "list-group-item" > Cras justo odio< / li >
< li class = "list-group-item" > Dapibus ac facilisis in< / li >
< li class = "list-group-item" > Morbi leo risus< / li >
< li class = "list-group-item" > Porta ac consectetur ac< / li >
< li class = "list-group-item" > Vestibulum at eros< / li >
< / ul >
< / div >
< / div >
{% highlight html %}
< div class = "panel panel-default" >
<!-- Default panel contents -->
< div class = "panel-heading" > Panel heading< / div >
< div class = "panel-body" >
< p > ...< / p >
< / div >
<!-- List group -->
< ul class = "list-group" >
< li class = "list-group-item" > Cras justo odio< / li >
< li class = "list-group-item" > Dapibus ac facilisis in< / li >
< li class = "list-group-item" > Morbi leo risus< / li >
< li class = "list-group-item" > Porta ac consectetur ac< / li >
< li class = "list-group-item" > Vestibulum at eros< / li >
< / ul >
< / div >
{% endhighlight %}
< / div >