Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### New features

* `navset_card_*()` now has a `full_screen` option to support `card()`'s existing full-screen functionality. (#1451)

* Added `ui.insert_nav_panel()`, `ui.remove_nav_panel()`, and `ui.update_nav_panel()` to support dynamic navigation. (#90)

* Added support for python 3.13. (#1711)
Expand Down
18 changes: 18 additions & 0 deletions shiny/ui/_navs.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ def __init__(
selected: Optional[str],
title: Optional[TagChild] = None,
sidebar: Optional[Sidebar] = None,
full_screen: bool = False,
header: TagChild = None,
footer: TagChild = None,
placement: Literal["above", "below"] = "above",
Expand All @@ -666,6 +667,7 @@ def __init__(
)
self.title = title
self.sidebar = sidebar
self.full_screen = full_screen
self.placement = placement

def layout(self, nav: Tag, content: Tag) -> Tag:
Expand Down Expand Up @@ -696,6 +698,7 @@ def layout(self, nav: Tag, content: Tag) -> Tag:
card_header(*nav_items) if self.placement == "above" else None,
*contents,
card_footer(*nav_items) if self.placement == "below" else None,
full_screen=self.full_screen,
)


Expand All @@ -706,6 +709,7 @@ def navset_card_tab(
selected: Optional[str] = None,
title: Optional[TagChild] = None,
sidebar: Optional[Sidebar] = None,
full_screen: bool = False,
header: TagChild = None,
footer: TagChild = None,
) -> NavSetCard:
Expand All @@ -724,6 +728,9 @@ def navset_card_tab(
``value``).
sidebar
A `Sidebar` component to display on every `nav()` page.
full_screen
If `True`, an icon will appear when hovering over the card body. Clicking the
icon expands the card to fit viewport size.
header
UI to display above the selected content.
footer
Expand Down Expand Up @@ -755,6 +762,7 @@ def navset_card_tab(
selected=selected,
title=title,
sidebar=sidebar,
full_screen=full_screen,
header=header,
footer=footer,
placement="above",
Expand All @@ -768,6 +776,7 @@ def navset_card_pill(
selected: Optional[str] = None,
title: Optional[TagChild] = None,
sidebar: Optional[Sidebar] = None,
full_screen: bool = False,
header: TagChild = None,
footer: TagChild = None,
placement: Literal["above", "below"] = "above",
Expand All @@ -787,6 +796,9 @@ def navset_card_pill(
``value``).
sidebar
A :class:`shiny.ui.Sidebar` component to display on every :func:`~shiny.ui.nav_panel` page.
full_screen
If `True`, an icon will appear when hovering over the card body. Clicking the
icon expands the card to fit viewport size.
header
UI to display above the selected content.
footer
Expand Down Expand Up @@ -820,6 +832,7 @@ def navset_card_pill(
selected=selected,
title=title,
sidebar=sidebar,
full_screen=full_screen,
header=header,
footer=footer,
placement=placement,
Expand All @@ -833,6 +846,7 @@ def navset_card_underline(
selected: Optional[str] = None,
title: Optional[TagChild] = None,
sidebar: Optional[Sidebar] = None,
full_screen: bool = False,
header: TagChild = None,
footer: TagChild = None,
placement: Literal["above", "below"] = "above",
Expand All @@ -852,6 +866,9 @@ def navset_card_underline(
``value``).
sidebar
A :class:`shiny.ui.Sidebar` component to display on every :func:`~shiny.ui.nav_panel` page.
full_screen
If `True`, an icon will appear when hovering over the card body. Clicking the
icon expands the card to fit viewport size.
header
UI to display above the selected content.
footer
Expand Down Expand Up @@ -885,6 +902,7 @@ def navset_card_underline(
selected=selected,
title=title,
sidebar=sidebar,
full_screen=full_screen,
header=header,
footer=footer,
placement=placement,
Expand Down
Loading