Type: | Package |
Title: | Shiny UI Widgets for Small Screens |
Version: | 0.1.2 |
Description: | Provides UI widget and layout functions for writing Shiny apps that work well on small screens. |
License: | GPL-3 |
URL: | https://github.com/rstudio/miniUI |
BugReports: | https://github.com/rstudio/miniUI/issues |
Imports: | shiny (≥ 0.13), htmltools (≥ 0.3), utils |
RoxygenNote: | 7.3.2 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2025-04-17 22:30:11 UTC; jcheng |
Author: | Joe Cheng [cre, aut],
Posit Software, PBC |
Maintainer: | Joe Cheng <joe@posit.co> |
Repository: | CRAN |
Date/Publication: | 2025-04-17 23:20:02 UTC |
Create a block-level button container
Description
Creates a full-width container for one or more buttons. The horizontal space will be evenly divided among any buttons that are added.
Usage
miniButtonBlock(..., border = "top")
Arguments
... |
One or more |
border |
Zero or more of |
Details
When using miniButtonBlock
with a miniTabstripPanel
, consider
passing the miniButtonBlock
to miniTabstripPanel
as the
between
argument.
See Also
For more information, see the Designing Gadget UI article on shiny.rstudio.com.
Examples
library(shiny)
miniButtonBlock(
actionButton("reset", "Reset to defaults"),
actionButton("clear", "Clear all")
)
Create a content panel
Description
Creates a panel for containing arbitrary content within a flex box container.
This is mainly useful within miniPage()
or a
miniTabPanel()
. You can use miniContentPanel
to introduce
padding and/or scrolling, but even if padding/scrolling aren't needed, it's a
good idea to wrap your custom content into miniContentPanel
as it
fixes some odd behavior with percentage-based heights.
Usage
miniContentPanel(..., padding = 15, scrollable = TRUE)
Arguments
... |
UI objects to be contained in the |
padding |
Amount of padding to apply. Can be numeric (in pixels) or
character (e.g. |
scrollable |
If |
See Also
For more information, see the Designing Gadget UI article on shiny.rstudio.com.
Examples
library(shiny)
miniContentPanel(padding = 0,
plotOutput("plot", height = "100%")
)
Page function for Shiny Gadgets
Description
Designed to serve as the outermost function call for your gadget UI. Similar
to shiny::fillPage()
, but always includes the Bootstrap CSS
library, and is designed to contain miniTitleBar()
,
miniTabstripPanel()
, miniContentPanel()
, etc.
Usage
miniPage(..., title = NULL, theme = NULL)
Arguments
... |
Elements to include within the page. |
title |
The title to use for the browser window/tab (it will not be shown in the document). |
theme |
URL to alternative Bootstrap stylesheet. |
See Also
For more information, see the Designing Gadget UI article on shiny.rstudio.com.
Create a tabstrip panel
Description
miniTabstripPanel
is a tabstrip panel that contains
miniTabPanel
elements. Similar to
shiny::tabsetPanel()
, but optimized for small page
sizes like mobile devices or the RStudio Viewer pane.
Usage
miniTabstripPanel(..., id = NULL, selected = NULL, between = NULL)
miniTabPanel(title, ..., value = title, icon = NULL)
Arguments
... |
For |
id |
If provided, you can use |
selected |
The |
between |
A tag or list of tags that should be inserted between the content (above) and tabstrip (below). |
title |
Display title for tab. |
value |
The value that should be sent when |
icon |
Icon to appear on the tab; see |
See Also
For more information, see the Designing Gadget UI article on shiny.rstudio.com.
Examples
library(shiny)
miniTabstripPanel(
miniTabPanel("Data", icon = icon("table"),
selectInput("dataset", "Data set", ls("package:datasets"))),
miniTabPanel("Subset", icon = icon("sliders"),
uiOutput("subset_ui")
)
)
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
|
left |
The |
right |
The |
inputId |
The |
label |
The text label to display on the button. |
primary |
If |
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")
)