88
99from ... import ui
1010from ..._docstring import add_example , no_example
11- from ...types import MISSING , MISSING_TYPE
11+ from ...types import DEPRECATED , MISSING , MISSING_TYPE , MaybeMissing
1212from ...ui ._accordion import AccordionPanel
1313from ...ui ._card import CardItem
1414from ...ui ._layout_columns import BreakpointsUser
15- from ...ui ._navs import NavMenu , NavPanel , NavSet , NavSetBar , NavSetCard
15+ from ...ui ._navs import (
16+ NavbarOptions ,
17+ NavbarOptionsPositionT ,
18+ NavMenu ,
19+ NavPanel ,
20+ NavSet ,
21+ NavSetBar ,
22+ NavSetCard ,
23+ )
1624from ...ui ._sidebar import SidebarOpenSpec , SidebarOpenValue
1725from ...ui .css import CssUnit
1826from .._recall_context import RecallContextManager
@@ -1067,17 +1075,16 @@ def navset_bar(
10671075 fillable : bool | list [str ] = True ,
10681076 gap : Optional [CssUnit ] = None ,
10691077 padding : Optional [CssUnit | list [CssUnit ]] = None ,
1070- position : Literal [
1071- "static-top" , "fixed-top" , "fixed-bottom" , "sticky-top"
1072- ] = "static-top" ,
10731078 header : TagChild = None ,
10741079 footer : TagChild = None ,
1075- bg : Optional [str ] = None ,
1076- # TODO: default to 'auto', like we have in R (parse color via webcolors?)
1077- inverse : bool = False ,
1078- underline : bool = True ,
1079- collapsible : bool = True ,
1080+ navbar_options : Optional [NavbarOptions ] = None ,
10801081 fluid : bool = True ,
1082+ # Deprecated ----
1083+ position : MaybeMissing [NavbarOptionsPositionT ] = DEPRECATED ,
1084+ bg : MaybeMissing [str | None ] = DEPRECATED ,
1085+ inverse : MaybeMissing [bool ] = DEPRECATED ,
1086+ underline : MaybeMissing [bool ] = DEPRECATED ,
1087+ collapsible : MaybeMissing [bool ] = DEPRECATED ,
10811088) -> RecallContextManager [NavSetBar ]:
10821089 """
10831090 Context manager for a set of nav items as a tabset inside a card container.
@@ -1095,16 +1102,15 @@ def navset_bar(
10951102 Choose a particular nav item to select by default value (should match it's
10961103 ``value``).
10971104 sidebar
1098- A :class:`~shiny.ui.Sidebar` component to display on every
1099- :func:`~shiny.ui.nav_panel` page.
1105+ A :class:`~shiny.ui.Sidebar` component to display on every :func:`~shiny.ui.nav_panel` page.
11001106 fillable
11011107 Whether or not to allow fill items to grow/shrink to fit the browser window. If
11021108 `True`, all `nav()` pages are fillable. A character vector, matching the value
11031109 of `nav()`s to be filled, may also be provided. Note that, if a `sidebar` is
11041110 provided, `fillable` makes the main content portion fillable.
11051111 gap
11061112 A CSS length unit defining the gap (i.e., spacing) between elements provided to
1107- `*args`.
1113+ `*args`. This value is only used when the navbar is `fillable`.
11081114 padding
11091115 Padding to use for the body. This can be a numeric vector (which will be
11101116 interpreted as pixels) or a character vector with valid CSS lengths. The length
@@ -1113,26 +1119,45 @@ def navset_bar(
11131119 the second value will be used for left and right. If three, then the first will
11141120 be used for top, the second will be left and right, and the third will be
11151121 bottom. If four, then the values will be interpreted as top, right, bottom, and
1116- left respectively.
1122+ left respectively. This value is only used when the navbar is `fillable`.
1123+ header
1124+ UI to display above the selected content.
1125+ footer
1126+ UI to display below the selected content.
1127+ fluid
1128+ ``True`` to use fluid layout; ``False`` to use fixed layout.
1129+ navbar_options
1130+ Configure the appearance and behavior of the navbar using
1131+ :func:`~shiny.ui.navbar_options` to set properties like position, background
1132+ color, and more.
1133+
1134+ `navbar_options` was added in v1.3.0 and replaces deprecated arguments
1135+ `position`, `bg`, `inverse`, `collapsible`, and `underline`.
11171136 position
1137+ Deprecated in v1.3.0. Please use `navbar_options` instead; see
1138+ :func:`~shiny.ui.navbar_options` for details.
1139+
11181140 Determines whether the navbar should be displayed at the top of the page with
11191141 normal scrolling behavior ("static-top"), pinned at the top ("fixed-top"), or
11201142 pinned at the bottom ("fixed-bottom"). Note that using "fixed-top" or
11211143 "fixed-bottom" will cause the navbar to overlay your body content, unless you
11221144 add padding (e.g., ``tags.style("body {padding-top: 70px;}")``).
1123- header
1124- UI to display above the selected content.
1125- footer
1126- UI to display below the selected content.
11271145 bg
1146+ Deprecated in v1.3.0. Please use `navbar_options` instead; see
1147+ :func:`~shiny.ui.navbar_options` for details.
1148+
11281149 Background color of the navbar (a CSS color).
11291150 inverse
1151+ Deprecated in v1.3.0. Please use `navbar_options` instead; see
1152+ :func:`~shiny.ui.navbar_options` for details.
1153+
11301154 Either ``True`` for a light text color or ``False`` for a dark text color.
11311155 collapsible
1132- ``True`` to automatically collapse the navigation elements into an expandable
1133- menu on mobile devices or narrow window widths.
1134- fluid
1135- ``True`` to use fluid layout; ``False`` to use fixed layout.
1156+ Deprecated in v1.3.0. Please use `navbar_options` instead; see
1157+ :func:`~shiny.ui.navbar_options` for details.
1158+
1159+ ``True`` to automatically collapse the elements into an expandable menu on
1160+ mobile devices or narrow window widths.
11361161 """
11371162 return RecallContextManager (
11381163 ui .navset_bar ,
@@ -1144,14 +1169,16 @@ def navset_bar(
11441169 fillable = fillable ,
11451170 gap = gap ,
11461171 padding = padding ,
1147- position = position ,
11481172 header = header ,
11491173 footer = footer ,
1174+ fluid = fluid ,
1175+ navbar_options = navbar_options ,
1176+ # Deprecated -- v1.3.0 2025-01 ----
1177+ position = position ,
11501178 bg = bg ,
11511179 inverse = inverse ,
11521180 underline = underline ,
11531181 collapsible = collapsible ,
1154- fluid = fluid ,
11551182 ),
11561183 )
11571184
0 commit comments