Navigation
Module reahl.web.bootstrap.navbar¶
New in version 3.2.
A Bootstrap Navbar is a header for a web application with all manner of useful content, including a navigation menu.
Navbar¶
-
class
reahl.web.bootstrap.navbar.
Navbar
(view)¶ A bootstrap Navbar can be used as page header in a web application. A Navbar can contain some branding text, a
Nav
and a smallForm
.You populate a Navbar using a NavbarLayout for complete control over how the Navbar is laid out, which of its possible elements are present and how they are composed themselves.
Parameters: view – (See reahl.web.fw.Widget
)
NavbarLayout¶
-
class
reahl.web.bootstrap.navbar.
NavbarLayout
(fixed_to=None, full=False, center_contents=False, colour_theme=None, bg_scheme=None)¶ Used to populate a Navbar.
Parameters: - fixed_to – If one of ‘top’ or ‘bottom’, the Navbar will stick to the top or bottom of the viewport.
- full – If True, the Navbar fills the available width.
- center_contents – If True, all the contents of the Navbar is centered within the Navbar itself.
- colour_theme – Whether the Navbar has a ‘dark’ or ‘light’ background.
- bg_scheme – Whether the Navbar should use ‘primary’ colors, an ‘inverse’ (light on dark) scheme or a ‘faded’ background.
-
set_brand_text
(brand_text)¶ Sets the brand to be a link to the home page that contains the given text.
Parameters: brand_text – Text to use for branding.
-
set_brand
(brand_html_element)¶ Sets brand_html_element to be used as branding.
Parameters: brand_html_element – An HTMLElement
to be used as branding.
-
add
(widget, left=None, right=None)¶ Adds the given Form or Nav widget to the Navbar.
Parameters: - widget – A
Nav
orForm
to add. - left – If True, widget is aligned to the left of the Navbar.
- right – If True, widget is aligned to the right of the Navbar.
- widget – A
-
add_toggle
(target_html_element, text=None)¶ Adds a link that toggles the display of the given target_html_element.
Parameters: - target_html_element – A
HTMLElement
- text – Text to be used on the toggle link.
- target_html_element – A
Table Of Contents
Previous topic
Module reahl.web.bootstrap.navs
Next topic
Package reahl.web.bootstrap.pagination