Skip to content

Commit 551f6d0

Browse files
committed
Close #492. Deprecate nav() in favor of nav_panel()
1 parent a5de5fa commit 551f6d0

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Other changes
2222

23+
* Closed #492: `shiny.ui.nav()` is now deprecated in favor of the more aptly named `shiny.ui.nav_panel()` (#876).
2324
* Update penguins example to credit Allison Horst and drop usage of `shiny.experimental` (#798).
2425

2526

shiny/ui/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
from ._markdown import markdown
8787
from ._modal import modal_button, modal, modal_show, modal_remove
8888
from ._navs import (
89-
nav,
89+
nav_panel,
9090
nav_menu,
9191
nav_control,
9292
nav_spacer,
@@ -102,6 +102,7 @@
102102
# Deprecated
103103
navset_pill_card,
104104
navset_tab_card,
105+
nav,
105106
)
106107
from ._notification import notification_show, notification_remove
107108
from ._output import (
@@ -267,7 +268,7 @@
267268
"modal_show",
268269
"modal_remove",
269270
# _navs
270-
"nav",
271+
"nav_panel",
271272
"nav_menu",
272273
"nav_control",
273274
"nav_spacer",
@@ -283,6 +284,7 @@
283284
# # Deprecated
284285
"navset_pill_card",
285286
"navset_tab_card",
287+
"nav",
286288
# _notification
287289
"notification_show",
288290
"notification_remove",

shiny/ui/_navs.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
__all__ = (
4-
"nav",
4+
"nav_panel",
55
"nav_menu",
66
"nav_control",
77
"nav_spacer",
@@ -17,6 +17,7 @@
1717
# Deprecated - 2023-08-15
1818
"navset_pill_card",
1919
"navset_tab_card",
20+
"nav",
2021
)
2122

2223
import copy
@@ -98,7 +99,7 @@ def tagify(self) -> None:
9899

99100

100101
@add_example()
101-
def nav(
102+
def nav_panel(
102103
title: TagChild,
103104
*args: TagChild,
104105
value: Optional[str] = None,
@@ -1394,3 +1395,24 @@ def navset_tab_card(
13941395
header=header,
13951396
footer=footer,
13961397
)
1398+
1399+
1400+
# Deprecated 2023-12-07
1401+
def nav(
1402+
title: TagChild,
1403+
*args: TagChild,
1404+
value: Optional[str] = None,
1405+
icon: TagChild = None,
1406+
) -> Nav:
1407+
"""Deprecated. Please use `nav_panel()` instead of `nav()`."""
1408+
warn_deprecated(
1409+
"`nav()` is deprecated. "
1410+
"This method will be removed in a future version, "
1411+
"please use :func:`~shiny.ui.nav_panel` instead."
1412+
)
1413+
return nav_panel(
1414+
title,
1415+
*args,
1416+
value=value,
1417+
icon=icon,
1418+
)

0 commit comments

Comments
 (0)