shiny.ui.page_navbar#

shiny.ui.page_navbar(*args, title=None, id=None, selected=None, position='static-top', header=None, footer=None, bg=None, inverse=False, collapsible=True, fluid=True, window_title=<shiny.types.MISSING_TYPE object>, lang=None)#

Create a navbar with a navs bar and a title.

Parameters
  • args (NavSetArg) – UI elements.

  • title (Union[str, Tag, TagList, None]) – The browser window title (defaults to the host URL of the page). Can also be set as a side effect via panel_title().

  • id (Optional[str]) – If provided, will create an input value that holds the currently selected nav item.

  • selected (Optional[str]) – Choose a particular nav item to select by default value (should match it’s value).

  • position (Literal[‘static-top’, ‘fixed-top’, ‘fixed-bottom’]) – Determines whether the navbar should be displayed at the top of the page with normal scrolling behavior (“static-top”), pinned at the top (“fixed-top”), or pinned at the bottom (“fixed-bottom”). Note that using “fixed-top” or “fixed-bottom” will cause the navbar to overlay your body content, unless you add padding (e.g., tags.style("body {padding-top: 70px;}")).

  • header (Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[ForwardRef]]]]) – UI to display above the selected content.

  • footer (Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[ForwardRef]]]]) – UI to display below the selected content.

  • bg (Optional[str]) – Background color of the navbar (a CSS color).

  • inverse (bool) – Either True for a light text color or False for a dark text color.

  • collapsible (bool) – True to automatically collapse the navigation elements into a menu when the width of the browser is less than 940 pixels (useful for viewing on smaller touchscreen device)

  • fluid (bool) – True to use fluid layout; False to use fixed layout.

  • window_title (Union[str, MISSING_TYPE]) – The browser’s window title (defaults to the host URL of the page). Can also be set as a side effect via panel_title().

  • lang (Optional[str]) – ISO 639-1 language code for the HTML page, such as "en" or "ko". This will be used as the lang in the <html> tag, as in <html lang="en">. The default, None, results in an empty string.

Return type

A UI element.

See also

nav(), nav_menu(), navset_bar(), page_fluid()

Example

See nav().