-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(navset): Add examples for navset (#1579)
- Loading branch information
1 parent
97dd4a7
commit 3b278e3
Showing
24 changed files
with
485 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_card_underline( | ||
ui.nav_control(ui.a("Shiny", href="https://shiny.posit.co", target="_blank")), | ||
ui.nav_control( | ||
ui.a( | ||
"Learn Shiny", | ||
href="https://shiny.posit.co/py/docs/overview.html", | ||
target="_blank", | ||
) | ||
), | ||
), | ||
id="tab", | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_card_underline(id="tab"): | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
|
||
with ui.nav_control(): | ||
ui.a( | ||
"Learn Shiny", | ||
href="https://shiny.posit.co/py/docs/overview.html", | ||
target="_blank", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_card_pill( | ||
ui.nav_menu( | ||
"Nav Menu items", | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
), | ||
id="card_pill", | ||
), | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_card_pill(id="card_pill"): | ||
with ui.nav_menu("Nav Menu items"): | ||
with ui.nav_panel("A"): | ||
"Page A content" | ||
with ui.nav_panel("B"): | ||
"Page B content" | ||
with ui.nav_panel("C"): | ||
"Page C content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_underline( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_spacer(), | ||
ui.nav_spacer(), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
id="navset_underline", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_underline(): | ||
with ui.nav_panel("Tab 1"): | ||
"Tab 1 content" | ||
ui.nav_spacer() | ||
ui.nav_spacer() | ||
with ui.nav_panel("Tab 2"): | ||
"Tab 2 content" | ||
with ui.nav_panel("Tab 3"): | ||
"Tab 3 content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_bar( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
title="Navset Bar", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_bar(title="Navset Bar", id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_card_pill( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_card_pill(id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_card_tab( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_card_tab(id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_card_underline( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_card_underline(id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_pill( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_pill(id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from shiny import App, ui | ||
|
||
app_ui = ui.page_fluid( | ||
ui.navset_pill_list( | ||
ui.nav_panel("A", "Panel A content"), | ||
ui.nav_panel("B", "Panel B content"), | ||
ui.nav_panel("C", "Panel C content"), | ||
ui.nav_menu( | ||
"Other links", | ||
ui.nav_panel("D", "Panel D content"), | ||
"----", | ||
"Description:", | ||
ui.nav_control( | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") | ||
), | ||
), | ||
id="tab", | ||
) | ||
) | ||
|
||
|
||
def server(input, output, session): | ||
pass | ||
|
||
|
||
app = App(app_ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from shiny.express import ui | ||
|
||
with ui.navset_pill_list(id="tab"): | ||
with ui.nav_panel("A"): | ||
"Panel A content" | ||
|
||
with ui.nav_panel("B"): | ||
"Panel B content" | ||
|
||
with ui.nav_panel("C"): | ||
"Panel C content" | ||
|
||
with ui.nav_menu("Other links"): | ||
with ui.nav_panel("D"): | ||
"Page D content" | ||
|
||
"----" | ||
"Description:" | ||
with ui.nav_control(): | ||
ui.a("Shiny", href="https://shiny.posit.co", target="_blank") |
Oops, something went wrong.