UINav: Build the app's page

View source: R/page.R

UINavR Documentation

Build the app's page

Description

The outermost UI function: use it as ui <- UINav(...). It builds a page with a navigation bar across the top holding, from left to right, any logos, the app name, one entry per tab you pass in, and a dark mode switch on the far right.

Usage

UINav(
  ...,
  logoFile = NULL,
  appName = NULL,
  logoHeight = "40vh",
  barColor = NULL,
  theme = bslib::bs_theme()
)

Arguments

...

Tabs to show in the navigation bar.

logoFile

File names of images to show at the left of the navigation bar, in order. Put the images in the app's www folder and give just the file name, for example "logo.png" (png, svg, jpg or gif). NULL (the default) or "" shows no logo.

appName

App name shown after the logos. If left NULL, a global variable called appName is used, or no name if there isn't one.

logoHeight

Height of each logo, as a CSS size. A single value is used for every logo.

barColor

Background color of the navigation bar, as a color name or hex code, for example "#005596". NULL uses the theme's default. Text color switches between light and dark to stay readable.

theme

A bslib::bs_theme() to style the whole app, for example bslib::bs_theme(primary = "#005596", preset = "cosmo").

Details

Pass tabs made with singleTab(), sidebarLevelTab(), biLevelTab() or triLevelTab(). The navigation bar has the ID "root", so the server can change tab with bslib::nav_select("root", "<tab title>").

Value

A 'shiny' page to use as the app's UI.

Examples

ui <- UINav(
  appName = "My App",
  barColor = "#005596",
  singleTab("Upload",
    navUpload("dataUpload", "Upload a CSV")
  ),
  singleTab("Results",
    navOutputTable("resultsTable")
  )
)

if (interactive()) {
  shiny::shinyApp(ui, function(input, output, session) {})
}

EZRShiny documentation built on Oct. 10, 2026, 5:08 p.m.