Learn R Programming

⚠️There's a newer version (1.10.0) 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.

R version support

Shiny is supported on the latest release version of R, as well as the previous four minor release versions of R. For example, if the latest release R version is 4.1, then that version is supported, as well as 4.0, 3.6, 3.5, and 3.4.

Copy Link

Version

Install

install.packages('shiny')

Monthly Downloads

554,825

Version

1.7.1

License

GPL-3 | file LICENSE

Maintainer

Winston Chang

Last Published

October 2nd, 2021

Functions in shiny (1.7.1)

bookmarkButton

Create a button for bookmarking/sharing
Progress

Reporting progress (object-oriented API)
bindEvent

Make an object respond only to specified reactive events
actionButton

Action button/link
absolutePanel

Panel with absolute positioning
bootstrapLib

Bootstrap libraries
applyInputHandlers

Apply input handlers to raw input values
MockShinySession

Mock Shiny Session
bindCache

Add caching with reactivity to an object
NS

Namespaced IDs for inputs/outputs
checkboxGroupInput

Checkbox Group Input Control
createRenderFunction

Implement custom render functions
conditionalPanel

Conditional Panel
bootstrapPage

Create a Bootstrap page
brushOpts

Create an object representing brushing options
debounce

Slow down a reactive expression with debounce/throttle
callModule

Invoke a Shiny module
brushedPoints

Find rows of data selected on an interactive plot.
dateRangeInput

Create date range input
domains

Reactive domains
downloadButton

Create a download button or link
column

Create a column within a UI definition
clickOpts

Control interactive plot point events
exportTestValues

Register expressions for export in test mode
exprToFunction

Convert an expression to a function
insertTab

Dynamically insert/remove a tabPanel
checkboxInput

Checkbox Input Control
downloadHandler

File Downloads
devmode

Shiny Developer Mode
getCurrentTheme

Obtain Shiny's Bootstrap Sass theme
diskCache

Create disk cache (deprecated)
getQueryString

Get the query string / hash component from the URL
dateInput

Create date input
fillPage

Create a page that fills the window
createWebDependency

Create a web dependency
icon

Create an icon
fileInput

File Upload Control
inputPanel

Input panel
markRenderFunction

Mark a function as a render function
markOutputAttrs

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

Enable bookmarking for a Shiny application
freezeReactiveVal

Freeze a reactive value
fillRow

Flex Box-based row/column layouts
headerPanel

Create a header panel
loadSupport

Load an app's supporting R files
fixedPage

Create a page with a fixed layout
helpText

Create a help text element
getCurrentOutputInfo

Get output information
isRunning

Check whether a Shiny application is running
insertUI

Insert and remove UI objects
markdown

Insert inline Markdown
invalidateLater

Scheduled Invalidation
is.reactivevalues

Checks whether an object is a reactivevalues object
htmlOutput

Create an HTML output element
onBookmark

Add callbacks for Shiny session bookmarking events
reactive

Create a reactive expression
maskReactiveContext

Evaluate an expression without a reactive context
onFlush

Add callbacks for Shiny session events
reactiveConsole

Activate reactivity in the console
modalDialog

Create a modal dialog UI
memoryCache

Create memory cache (deprecated)
makeReactiveBinding

Make a reactive variable
reactiveFileReader

Reactive file reader
reactivePoll

Reactive polling
flowLayout

Flow layout
isolate

Create a non-reactive scope for an expression
fluidPage

Create a page with fluid layout
knitr_methods

Knitr S3 methods
runTests

Runs the tests associated with this Shiny app
runGadget

Run a gadget
httpResponse

Create an HTTP response object
plotPNG

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

Create a reactive observer
observeEvent

Event handler
getShinyOption

Get or set Shiny options
pageWithSidebar

Create a page with a sidebar
moduleServer

Shiny modules
isTruthy

Truthy and falsy values
navbarPage

Create a page with a top level navigation bar
removeInputHandler

Deregister an Input Handler
runApp

Run Shiny Application
renderCachedPlot

Plot output with cached images
runExample

Run Shiny Example Applications
shinyServer

Define Server Functionality
numericInput

Create a numeric input control
navlistPanel

Create a navigation list panel
onStop

Run code after an application or session ends
shiny-package

Web Application Framework for R
setSerializer

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

Create a submit button
outputOptions

Set options for an output object.
parseQueryString

Parse a GET query string from a URL
tabPanel

Create a tab panel
titlePanel

Create a panel containing an application title.
textOutput

Create a text output element
registerInputHandler

Register an Input Handler
passwordInput

Create a password input control
withProgress

Reporting progress (functional API)
reactlog

Reactive Log Visualizer
radioButtons

Create radio buttons
req

Check for required values
registerThemeDependency

Register a theme dependency
repeatable

Make a random number generator repeatable
shinyAppTemplate

Generate a Shiny application from a template
sizeGrowthRatio

Create a sizing function that grows at a given ratio
shinyDeprecated

Print message for deprecated functions in Shiny
reexports

Objects exported from other packages
showTab

Dynamically hide/show a tabPanel
reactiveTimer

Timer
reactiveVal

Create a (single) reactive value
renderPlot

Plot Output
renderImage

Image file output
shiny.appobj

Shiny App object
dataTableOutput

Table output with the JavaScript DataTables library
shinyApp

Create a Shiny app object
snapshotPreprocessOutput

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

Show or remove a notification
showModal

Show or remove a modal dialog
sliderInput

Slider Input Widget
tabsetPanel

Create a tabset panel
splitLayout

Split layout
updateTextInput

Change the value of a text input on the client
urlModal

Generate a modal dialog that displays a URL
reactiveValues

Create an object for storing reactive values
addResourcePath

Resource Publishing
tableOutput

Table Output
reactiveValuesToList

Convert a reactivevalues object to a list
plotOutput

Create an plot or image output element
restoreInput

Restore an input value
renderUI

UI Output
serverInfo

Collect information about the Shiny Server environment
selectInput

Create a select list input control
testServer

Reactive testing for Shiny server functions and modules
updateCheckboxInput

Change the value of a checkbox input on the client
textInput

Create a text input control
textAreaInput

Create a textarea input control
updateDateInput

Change the value of a date input on the client
varSelectInput

Select variables from a data frame
validate

Validate input values and other conditions
verticalLayout

Lay out UI elements vertically
renderPrint

Text Output
viewer

Viewer options
runUrl

Run a Shiny application from a URL
session

Session object
safeError

Declare an error safe for the user to see
updateTabsetPanel

Change the selected tab on the client
shinyUI

Create a Shiny UI handler
setBookmarkExclude

Exclude inputs from bookmarking
stacktrace

Stack trace manipulation functions
updateActionButton

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

Update URL in browser's location bar
stopApp

Stop the currently running Shiny app
showBookmarkUrlModal

Display a modal dialog for bookmarking
updateCheckboxGroupInput

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

Layout a sidebar and main area
wellPanel

Create a well panel
updateTextAreaInput

Change the value of a textarea input on the client
snapshotExclude

Mark an output to be excluded from test snapshots
withMathJax

Load the MathJax library and typeset math expressions
updateSelectInput

Change the value of a select input on the client
updateDateRangeInput

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

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

Change the value of a number input on the client
updateSliderInput

Update Slider Input Widget
updateRadioButtons

Change the value of a radio input on the client