Learn R Programming

⚠️There's a newer version (1.9.1) of this package.Take me there.

shiny

Easily build rich and productive interactive web apps in R — no HTML/CSS/JavaScript required.

Features

  • An intuitive and extensible reactive programming model which makes it easy to transform existing R code into a "live app" where outputs automatically react to new user input.
    • Compared to event-based programming, reactivity allows Shiny to do the minimum amount of work when input(s) change, and allows humans to more easily reason about complex MVC logic.
  • A prebuilt set of highly sophisticated, customizable, and easy-to-use widgets (e.g., plots, tables, sliders, dropdowns, date pickers, and more).
  • An attractive default look based on Bootstrap which can also be easily customized with the bslib package or avoided entirely with more direct R bindings to HTML/CSS/JavaScript.
  • Seamless integration with R Markdown, making it easy to embed numerous applications natively within a larger dynamic document.
  • Tools for improving and monitoring performance, including native support for async programming, caching, load testing, and more.
  • Modules: a framework for reducing code duplication and complexity.
  • An ability to bookmark application state and/or generate code to reproduce output(s).
  • A rich ecosystem of extension packages for more custom widgets, input validation, unit testing, and more.

Installation

To install the stable version from CRAN:

install.packages("shiny")

Getting Started

Once installed, load the library and run an example:

library(shiny)
# Launches an app, with the app's source code included
runExample("06_tabsets")
# Lists more prepackaged examples
runExample()

For more examples and inspiration, check out the Shiny User Gallery.

For help with learning fundamental Shiny programming concepts, check out the Mastering Shiny book and the Shiny Tutorial. The former is currently more up-to-date with modern Shiny features, whereas the latter takes a deeper, more visual, dive into fundamental concepts.

Getting Help

To ask a question about Shiny, please use the RStudio Community website.

For bug reports, please use the issue tracker and also keep in mind that by writing a good bug report, you're more likely to get help with your problem.

Contributing

We welcome contributions to the shiny package. Please see our CONTRIBUTING.md file for detailed guidelines of how to contribute.

License

The shiny package as a whole is licensed under the GPLv3. See the LICENSE file for more details.

Copy Link

Version

Install

install.packages('shiny')

Monthly Downloads

543,282

Version

1.6.0

License

GPL-3 | file LICENSE

Maintainer

Last Published

January 25th, 2021

Functions in shiny (1.6.0)

absolutePanel

Panel with absolute positioning
conditionalPanel

Conditional Panel
brushOpts

Create an object representing brushing options
bootstrapPage

Create a Bootstrap page
clickOpts

Control interactive plot point events
column

Create a column within a UI definition
bindCache

Add caching with reactivity to an object
checkboxInput

Checkbox Input Control
bindEvent

Make an object respond only to specified reactive events
checkboxGroupInput

Checkbox Group Input Control
downloadButton

Create a download button or link
createWebDependency

Create a web dependency
dateInput

Create date input
debounce

Slow down a reactive expression with debounce/throttle
dateRangeInput

Create date range input
createRenderFunction

Implement render functions
exprToFunction

Convert an expression to a function
inputPanel

Input panel
fileInput

File Upload Control
insertTab

Dynamically insert/remove a tabPanel
fillPage

Create a page that fills the window
downloadHandler

File Downloads
fillRow

Flex Box-based row/column layouts
getQueryString

Get the query string / hash component from the URL
domains

Reactive domains
diskCache

Create disk cache (deprecated)
enableBookmarking

Enable bookmarking for a Shiny application
headerPanel

Create a header panel
flowLayout

Flow layout
fixedPage

Create a page with a fixed layout
brushedPoints

Find rows of data selected on an interactive plot.
callModule

Invoke a Shiny module
parseQueryString

Parse a GET query string from a URL
makeReactiveBinding

Make a reactive variable
passwordInput

Create a password input control
markOutputAttrs

Mark a render function with attributes that will be used by the output
knitr_methods

Knitr S3 methods
icon

Create an icon
httpResponse

Create an HTTP response object
fluidPage

Create a page with fluid layout
moduleServer

Shiny modules
modalDialog

Create a modal dialog UI
outputOptions

Set options for an output object.
loadSupport

Load an app's supporting R files
navbarPage

Create a page with a top level navigation bar
navlistPanel

Create a navigation list panel
deprecatedReactives

Deprecated reactive functions
helpText

Create a help text element
freezeReactiveVal

Freeze a reactive value
pageWithSidebar

Create a page with a sidebar
htmlOutput

Create an HTML output element
insertUI

Insert and remove UI objects
maskReactiveContext

Evaluate an expression without a reactive context
installExprFunction

Install an expression as a function
onStop

Run code after an application or session ends
onFlush

Add callbacks for Shiny session events
memoryCache

Create memory cache (deprecated)
exportTestValues

Register expressions for export in test mode
reactiveTimer

Timer
addResourcePath

Resource Publishing
invalidateLater

Scheduled Invalidation
is.reactivevalues

Checks whether an object is a reactivevalues object
devmode

Shiny Developer Mode
markdown

Insert inline Markdown
markRenderFunction

Mark a function as a render function
observeEvent

Event handler
reactiveVal

Create a (single) reactive value
quoToFunction

Convert a quosure to a function for a Shiny render function
radioButtons

Create radio buttons
reactlog

Reactive Log Visualizer
reexports

Objects exported from other packages
registerInputHandler

Register an Input Handler
repeatable

Make a random number generator repeatable
renderUI

UI Output
registerThemeDependency

Register a theme dependency
renderTable

Table Output
onBookmark

Add callbacks for Shiny session bookmarking events
restoreInput

Restore an input value
plotOutput

Create an plot or image output element
setSerializer

Add a function for serializing an input before bookmarking application state
getCurrentOutputInfo

Get output information
plotPNG

Run a plotting function and save the output as a PNG
runUrl

Run a Shiny application from a URL
req

Check for required values
shiny-package

Web Application Framework for R
reactiveValues

Create an object for storing reactive values
showTab

Dynamically hide/show a tabPanel
getCurrentTheme

Obtain Shiny's Bootstrap Sass theme
shinyAppTemplate

Generate a Shiny application from a template
safeError

Declare an error safe for the user to see
shinyApp

Create a Shiny app object
shiny.appobj

Shiny App object
sidebarLayout

Layout a sidebar and main area
reactiveFileReader

Reactive file reader
snapshotPreprocessOutput

Add a function for preprocessing an output before taking a test snapshot
reactiveValuesToList

Convert a reactivevalues object to a list
isRunning

Check whether a Shiny application is running
shinyDeprecated

Print message for deprecated functions in Shiny
sizeGrowthRatio

Create a sizing function that grows at a given ratio
stacktrace

Stack trace manipulation functions
splitLayout

Split layout
stopApp

Stop the currently running Shiny app
updateRadioButtons

Change the value of a radio input on the client
isolate

Create a non-reactive scope for an expression
tabsetPanel

Create a tabset panel
updateQueryString

Update URL in browser's location bar
tableOutput

Create a table output element
updateNumericInput

Change the value of a number input on the client
removeInputHandler

Deregister an Input Handler
updateSelectInput

Change the value of a select input on the client
viewer

Viewer options
wellPanel

Create a well panel
testServer

Reactive testing for Shiny server functions and modules
sliderInput

Slider Input Widget
renderCachedPlot

Plot output with cached images
runGadget

Run a gadget
renderPrint

Text Output
reactivePoll

Reactive polling
renderPlot

Plot Output
runApp

Run Shiny Application
textAreaInput

Create a textarea input control
varSelectInput

Select variables from a data frame
verticalLayout

Lay out UI elements vertically
runExample

Run Shiny Example Applications
session

Session object
runTests

Runs the tests associated with this Shiny app
showModal

Show or remove a modal dialog
setBookmarkExclude

Exclude inputs from bookmarking
observe

Create a reactive observer
numericInput

Create a numeric input control
reactive

Create a reactive expression
shinyUI

Create a Shiny UI handler
showNotification

Show or remove a notification
snapshotExclude

Mark an output to be excluded from test snapshots
showBookmarkUrlModal

Display a modal dialog for bookmarking
tabPanel

Create a tab panel
submitButton

Create a submit button
textOutput

Create a text output element
textInput

Create a text input control
updateDateInput

Change the value of a date input on the client
snapshotPreprocessInput

Add a function for preprocessing an input before taking a test snapshot
updateDateRangeInput

Change the start and end values of a date range input on the client
reactiveConsole

Activate reactivity in the console
renderDataTable

Table output with the JavaScript library DataTables
updateCheckboxGroupInput

Change the value of a checkbox group input on the client
renderImage

Image file output
withProgress

Reporting progress (functional API)
withMathJax

Load the MathJax library and typeset math expressions
selectInput

Create a select list input control
serverInfo

Collect information about the Shiny Server environment
updateCheckboxInput

Change the value of a checkbox input on the client
updateTextAreaInput

Change the value of a textarea input on the client
updateTextInput

Change the value of a text input on the client
getShinyOption

Get or set Shiny options
shinyServer

Define Server Functionality
titlePanel

Create a panel containing an application title.
updateActionButton

Change the label or icon of an action button on the client
updateSliderInput

Update Slider Input Widget
updateTabsetPanel

Change the selected tab on the client
urlModal

Generate a modal dialog that displays a URL
validate

Validate input values and other conditions
Progress

Reporting progress (object-oriented API)
applyInputHandlers

Apply input handlers to raw input values
bookmarkButton

Create a button for bookmarking/sharing
bootstrapLib

Bootstrap libraries
actionButton

Action button/link
MockShinySession

Mock Shiny Session
NS

Namespaced IDs for inputs/outputs