lintel-contrib-navs
Navigation tools for lintel.
Getting Started
This module requires Lintel.
If you haven't used Lintel before, be sure to check out the Getting Started guide, as it explains how to install and use this module. Once you're familiar with that process, you may install this module with this command:
bower install lintel-contrib-navs --save
Once the module has been installed, you will have to load it in your main SASS file:
This module also includes a JavaScript component, which you will have to load separately.
You can use wiredep or grunt-wiredep to automatically inject files in your build process.
Variables
Check the vars file in the sass
folder to see the full list of variables you can customize.
$nav-padding-y
Default value: $cushion-y-md
Change the default padding-top and padding-bottom.
$nav-padding-x
Default value: $cushion-x-md
Change the default padding-left and padding-right.
$nav-margin-y
Default value: $cushion-y-md
Change the vertical space between nav items.
$nav-padding-x
Default value: 4px
Change the horizontal space between items.
Tab Variables
Tabs prefixed with $nav-tabs-*
are tab specific.
$nav-tabs-bg
Tab background.
$nav-tabs-border
Tab border.
$nav-tabs-border-list
Tab-list border.
$nav-tabs-border-radius
Tab border-radius.
$nav-tabs-text
Tab text color.
Use $nav-tabs-active-bg
, $nav-tabs-active-border
, and $nav-tabs-active-text
to customize active colors.
Use $nav-tabs-hover-bg
, $nav-tabs-hover-border
, and $nav-tabs-hover-text
to customize hover colors.
Pills and Flat Variables
Same as tabs except $nav-pills-*
and $nav-flat-*
.
JavaScript
Options
Name | Type | Default | Description |
---|---|---|---|
onShow | function | Callback function to execute every time tab is shown. | |
onHide | function | Callback function to execute every time tab is hidden. | |
show | boolean | true | Show tab when invoking .tab() |
Events
Event | Description |
---|---|
show.lt.tab | Fires immediately before tab is shown. Can prevent tab from showing here. |
shown.lt.tab | Fires immediately after tab is shown. |
hide.lt.tab | Fires immediately before tab is hidden. Can prevent tab from hiding here. |
hidden.lt.tab | Fires immediately after tab is hidden. |
Data-attr
Add data-toggle="tab"
and data-target="#selector"
to a tab.
You can add additional options as data-attributes.
Home Profile Activity .........
jQuery
Call the jQuery plugin on the tab, passing in any options.
var options = { console; } { console; }; ;
Alternatively, you can use the default options:
;
Examples
Tabs
Home Profile Activity
Vertical Tabs Left
...
Vertical Tabs Right
...
Pills
...
Flat
...
Tabs with Content
Keep the following in mind:
<ul>
s should haverole="tablist"
<li>
s should haverole="presentation"
- class of
.active
if active
- class of
<a>
s should havedata-toggle="tab"
or be activated manually through jshref
should point to the id of the tab it is forrole="tab"
should be definedaria-controls
should point to the id of the tab it is for (same value ashref
)aria-expanded
should betrue
for the active tab,false
for the others
.tab-panel
should have an id ofrole="tabpanel"
- class of
.active
if active - style of
display: none;
if inactive
- class of
Home Profile Activity ... ... ...
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License
Copyright (c) 2015 Marius Craciunoiu. Licensed under the MIT license.