You can fill your app with content, but can you organize it?
Tip
This section is a bit of a survey. Just know:
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
Any guesses which module we will use?
An app is a web page. ui
functions emit HTML.
There are even functions to insert HTML
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
Cards
Tabsets
Sidebars
Navbars
Rows and Columns
Filling the page
Caveat
The language and links in the layouts gallery tend to describe Shiny Core syntax.
So combine it with the Shiny Express function reference.
with ui.card():
ui.card_header()
and ui.card_footer()
Can any of our Python users explain?
with
is a convenient way to group multiple functions within a single context.
with
with sidebarsAdding a title to an App also helps to give it structure. Add titles with
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
Value boxes can have:
Tip
The faicons
package provides fontawesome icons.
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
What if you want to customize your layout more generally?
ui.layout_columns()
ui.layout_columns()
demolayout_column
functionscol_widths
would create this layout?layout_column
functionscol_widths
would create this layout?layout_column
functionscol_widths
would create this layout?layout_column
functionsrow_heights
are proportional to each other
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
with ui.nav_panel()
to create a panel with a title and contents.ui.navset_bar()
ui.navset_tab()
, ui.navset_card_tab()
ui.navset_pill()
, ui.navset_card_pill()
ui.navset_pill_list()
ui.navset_underline()
, ui.navset_card_underline()
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
If there are top level Nav Panels (with ui.nav_panel("A"):
), Shiny will automatically group them into a multi-page app with a navbar.
Tip
Use ui.page_opts()
to provide a title for the navbar.
Call ui.nav_spacer()
to push the panel labels to the right side of the navbar.
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
Yes, in several ways.
Explore this topic here.
Would you like to control how elements resize as the viewer’s screen size changes?
Explore this topic here.
Agenda
Introduction
Cards
Sidebars
Value boxes
Rows and columns
Tabsets
Navbars
Two advanced topics
Recap
ui.card()
ui.navset_tab()
ui.sidebar()
ui.navset_bar()