No commit activity in last 3 years
No release in over 3 years
Helpers to generate a Zurb Foundation style navigation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 3.0.2
>= 0
>= 0
~> 2.14.1
 Project Readme

Foundation Navigation

Gem Version Build Status Dependency Status Code Climate

Installation

Add this line to your application's Gemfile:

gem 'foundation-navigation'

And then execute:

$ bundle

Or install it yourself as:

$ gem install foundation-navigation

Usage

Topbar

See http://foundation.zurb.com/docs/components/top-bar.html

Example

This Haml snippet

= topbar(title: 'Expo') do
  - left do
    - dropdown 'Community', 'http://www.zurb.com/expo/community'  do
      - menu_item 'Forrst', 'http://www.forrst.com'
      - menu_item 'Soapbox', 'http://www.zurb.com/soapbox'
  - right do
    - menu_item 'Courses', '#'
    - dropdown 'Library' do
      - menu_item 'Pattern Tap', 'http://patterntap.com'
      - menu_item 'Word', 'http://www.zurb.com/word'
      - menu_item 'Responsive', 'http://www.zurb.com/responsive'

generates the following top-bar

Sample Top Bar

Methods

topbar

= topbar

or with specific options

= topbar title: 'Example', title_link: 'http://www.example.com', sticky: true

Options:

  • title: Page Title (Default: empty)
  • title_link: Link on Title (Default: #)
  • contain_to_grid: Wraps top-bar in contain-to-grid div (Default: false)
  • fixed: Wraps top-bar in fixed div (Default: false)
  • sticky: Wraps top-bar in sticky div (Default: false)

menu_group/left/right

Helpers to nest menu-item groups and arrange them within the topbar.

= topbar do
  - menu_group do             # <ul>...</ul>
  # or
  - left do                   # <ul class='left'>...</ul>
    ...
  - right do                  # <ul class='right'>...</ul>
    ...

divider

Adds a divider element

= topbar do
  - menu_group do             # <ul>...</ul>
    - divider                 # <li class="divider"></li>
    ...
    - divider                 # <li class="divider"></li>

dropdown

Groups nested elements and renders them as dropdown box

= topbar do
  - left do
    - dropdown 'caption' do
      ...

generates the following markup

...
<ul>
  <li class="has-dropdown not-click">
    <a href="#">caption</a>
  </li>
</ul>
<ul class="dropdown">
  ...
</ul>

Options:

  • Dropdown caption
  • Dropdown link (on the caption, default: '#')

menu_item

Renders a single link and can be nested in a menu_group or a dropdown.

= topbar do
  ...
    - menu_item 'Title', '/link'  # <a href='/link'>Title</a>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request