miniTitleBar: Create a title bar

View source: R/layout.R

miniTitleBarR Documentation

Create a title bar

Description

Creates a title bar for a Shiny app or Shiny Gadget. Intended to be used with miniPage(). Title bars contain a title, and optionally, a miniTitleBarButton on the left and/or right sides.

Usage

miniTitleBar(title, left = NULL, right = NULL)

gadgetTitleBar(
  title,
  left = miniTitleBarCancelButton(),
  right = miniTitleBarButton("done", "Done", primary = TRUE)
)

miniTitleBarButton(inputId, label, primary = FALSE)

miniTitleBarCancelButton(inputId = "cancel", label = "Cancel", primary = FALSE)

Arguments

title

The title of the gadget. If this needs to be dynamic, pass shiny::textOutput() with inline = TRUE.

left

The miniTitleBarButton to put on the left, or NULL for none.

right

The miniTitleBarButton to put on the right, or NULL for none.

inputId

The input slot that will be used to access the button.

label

The text label to display on the button.

primary

If TRUE, render the button in a bold color to indicate that it is the primary action of the gadget.

Details

gadgetTitleBar is a miniTitleBar with different defaults: a Cancel button on the left and a Done button on the right. By default, shiny::runGadget() will handle the Cancel button by closing the gadget and raising an error, but the Done button must be handled by the gadget author using observeEvent(input$done, {...}).

miniTitleBarCancelButton is like miniTitleBarButton, but the user can also invoke it by hitting the Escape key.

See Also

For more information, see the Designing Gadget UI article on shiny.rstudio.com.

Examples

miniTitleBar("My App",
  left = miniTitleBarButton("prev", "Previous"),
  right = miniTitleBarButton("next", "Next")
)


miniUI documentation built on June 8, 2025, 12:44 p.m.