nav {bslib}R Documentation

Navigation items

Description

Create nav item(s) for use inside nav containers (e.g., navs_tab(), navs_bar(), etc).

Usage

nav(title, ..., value = title, icon = NULL)

nav_menu(title, ..., value = title, icon = NULL, align = c("left", "right"))

nav_content(value, ..., icon = NULL)

nav_item(...)

nav_spacer()

Arguments

title

A title to display. Can be a character string or UI elements (i.e., tags).

...

Depends on the function:

  • For nav() and nav_content(): UI elements (i.e., tags) to display when the item is active.

  • For nav_menu(): a collection of nav items (e.g., nav(), nav_item()).

  • For nav_item(): UI elements (i.e., tags) to place directly in the navigation panel (e.g., search forms, links to external content, etc).

value

A character string to assign to the nav item. This value may be supplied to the relevant container's selected argument in order to show particular nav item's content immediately on page load. This value is also useful for programmatically updating the selected content via nav_select(), nav_hide(), etc (updating selected tabs this way is often useful for showing/hiding panels of content via other UI controls like shiny::radioButtons() – in this scenario, consider using nav_content() with navs_hidden()).

icon

Optional icon to appear next to the nav item's title.

align

horizontal alignment of the dropdown menu relative to dropdown toggle.

Value

A nav item that may be passed to a nav container (e.g. navs_tab()).

Functions

See Also

navs_tab(), nav_select().


[Package bslib version 0.3.1 Index]