ui.page_navbar
ui.page_navbar(
*args,
title=None,
id=None,
selected=None,
sidebar=None,
fillable=False,
fillable_mobile=False,
gap=None,
padding=None,
header=None,
footer=None,
navbar_options=None,
fluid=True,
window_title=MISSING,
lang=None,
theme=None,
position=DEPRECATED,
bg=DEPRECATED,
inverse=DEPRECATED,
underline=DEPRECATED,
collapsible=DEPRECATED,
)Create a page with a navbar and a title.
Parameters
*args : NavSetArg | MetadataNode | Sequence[MetadataNode] = ()-
UI elements.
title : Optional[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] = None-
If provided, will create an input value that holds the currently selected nav item.
selected : Optional[str] = None-
Choose a particular nav item to select by default value (should match its
value). sidebar : Optional[Sidebar] = None-
A
sidebarcomponent to display on every page. fillable : bool |list[str] = False-
Whether or not the main content area should be considered a fillable (i.e., flexbox) container.
fillable_mobile : bool = False-
Whether or not
fillableshould apply on mobile devices. gap : Optional[CssUnit] = None-
A CSS length unit defining the gap (i.e., spacing) between elements provided to
*args. This value is only used when the navbar is fillable. padding : Optional[CssUnit |list[CssUnit]] = None-
Padding to use for the body. This can be a numeric vector (which will be interpreted as pixels) or a character vector with valid CSS lengths. The length can be between one and four. If one, then that value will be used for all four sides. If two, then the first value will be used for the top and bottom, while the second value will be used for left and right. If three, then the first will be used for top, the second will be left and right, and the third will be bottom. If four, then the values will be interpreted as top, right, bottom, and left respectively. This value is only used when the navbar is fillable.
header : Optional[TagChild] = None-
UI to display above the selected content.
footer : Optional[TagChild] = None-
UI to display below the selected content.
window_title : str | MISSING_TYPE = MISSING-
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] = None-
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. theme : Optional[str | Path |Theme|ThemeProvider] = None-
A custom Shiny theme created using the
Themeclass, or a path to a local or online CSS file that will replace the Bootstrap CSS bundled by default with a Shiny app. This file should be a completebootstrap.cssorbootstrap.min.cssfile. For advanced uses, you can also pass aTagifiableobject. In this case, Shiny will suppress the default Bootstrap CSS. To modify the theme of an app without replacing the Bootstrap CSS entirely, useinclude_cssto add custom CSS. fluid : bool = True-
Trueto use fluid layout;Falseto use fixed layout. navbar_options : Optional[NavbarOptions] = None-
Configure the appearance and behavior of the navbar using
navbar_optionsto set properties like position, background color, and more.navbar_optionswas added in v1.3.0 and replaces deprecated argumentsposition,bg,inverse,collapsible, andunderline. position : Literal[‘static-top’, ‘fixed-top’, ‘fixed-bottom’] | MISSING_TYPE = DEPRECATED-
Deprecated in v1.3.0. Please use
navbar_optionsinstead; seenavbar_optionsfor details. 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;}")). bg : str | None | MISSING_TYPE = DEPRECATED-
Deprecated in v1.3.0. Please use
navbar_optionsinstead; seenavbar_optionsfor details. Background color of the navbar (a CSS color). inverse : bool | MISSING_TYPE = DEPRECATED-
Deprecated in v1.3.0. Please use
navbar_optionsinstead; seenavbar_optionsfor details. EitherTruefor a light text color orFalsefor a dark text color. collapsible : bool | MISSING_TYPE = DEPRECATED-
Deprecated in v1.3.0. Please use
navbar_optionsinstead; seenavbar_optionsfor details.Trueto automatically collapse the elements into an expandable menu on mobile devices or narrow window widths.
Returns
: Tag-
A UI element.
See Also
Example
See nav.