shiny.ui.nav_menu#

shiny.ui.nav_menu(title, *args, value=None, icon=None, align='left')#

Create a menu of nav items.

Parameters
  • title (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]]]]) – A title to display. Can be a character string or UI elements (i.e., tags).

  • *args – A collection of nav items (e.g., nav()) and/or strings. Strings will be rendered as a section header unless the string is a set of two or more hyphens (e.g., ---), in which case it will be rendered as a divider.

  • value (Optional[str]) – The value of the item. This is used to determine whether the item is active (when an id is provided to the nav container), programmatically select the item (e.g., update_navs()), and/or be provided to the selected argument of the navigation container (e.g., navset_tab()).

  • icon (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]]]]) – An icon to appear inline with the button/link.

  • align (Literal[‘left’, ‘right’]) – Horizontal alignment of the dropdown menu relative to dropdown toggle.

Return type

A UI element representing both the navigation menu.

Example

See nav()