Learn R Programming

miniUI (version 0.1.1.1)

miniTitleBar: 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 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, 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

Run this code
# NOT RUN {
miniTitleBar("My App",
  left = miniTitleBarButton("prev", "Previous"),
  right = miniTitleBarButton("next", "Next")
)

# }

Run the code above in your browser using DataLab