Skip to main content

Easily create navigation for Flask applications. An extended copy of Flask_nav 0.6

Project description


`Flask-Nav <>`_ is a `Flask <>`_-Extension to ease the creation
of navigational Elements in Applications. It provides means to Express the
Navigational structure and different ways to render these, making it easy to
custom tailor it for your application.

Flask-NavBar is an extended copy of Flask_nav 0.6.

Flask-NavBar extends features below:

1. support setting a font-awesome icon before nav item;
2. support inverse navbar;
3. support fixed navbar;
4. support navbar brand logo;
5. support right-side navbar;
6. support navbar search form.

.. code-block:: python

from flask import Flask
from flask_navbar import Nav
from flask_navbar.elements import *

nav = Nav()

# registers the "top" menubar
nav.register_element('top', Navbar(
View('Widgits, Inc.', 'index'),
View('Our Mission', 'about', icon='fa fa-comment'),
View('Wg240-Series', 'products', product='wg240'),
View('Wg250-Series', 'products', product='wg250'),
Text('Discontinued Products'),
View('Wg10X', 'products', product='wg10x'),
Link('Tech Support', 'http://techsupport.invalid/widgits_inc', icon='fa fa-home'),
Search('/search', navbar_right=True, icon='fa fa-search', btn_text='Go',
input_placeholder='Search...', input_name='q', input_id='q', ),

app = Flask(__name__)
# [...] (view definitions)

# If using flask_bootstrap, nav must init first


.. code-block:: html

<!doctype html>
<title>{{msg|default('example page')}}</title>
<link href="path/to/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='base.css')}}">
<script src="path/to/bootstrap/js/bootstrap.min.js"></script>
<script src="path/to/jquery/js/jquery.min.js"></script>

You can find a small, runnable example application inside the example folder. To run it, execute:

.. code-block::

# use `set FLASK_APP=example` on Windows
export FLASK_APP=example
flask run



.. |image| image:: snapshot.png

The `Flask-Nav full documentation <>`_ can be found on PyPI.

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-navbar-1.0.tar.gz (8.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page