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.

Join the conversation

If you want to chat about Shiny, meet other developers, or help us decide what to work on next, join us on Discord.

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

603,721

Version

1.9.1

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 1st, 2024

Functions in shiny (1.9.1)

NS

Namespaced IDs for inputs/outputs
absolutePanel

Panel with absolute positioning
ExtendedTask

Task or computation that proceeds in the background
bindCache

Add caching with reactivity to an object
applyInputHandlers

Apply input handlers to raw input values
bindEvent

Make an object respond only to specified reactive events
actionButton

Action button/link
MockShinySession

Mock Shiny Session
Progress

Reporting progress (object-oriented API)
busyIndicatorOptions

Customize busy indicator options
clickOpts

Control interactive plot point events
column

Create a column within a UI definition
checkboxInput

Checkbox Input Control
checkboxGroupInput

Checkbox Group Input Control
brushOpts

Create an object representing brushing options
callModule

Invoke a Shiny module
bookmarkButton

Create a button for bookmarking/sharing
bootstrapLib

Bootstrap libraries
bootstrapPage

Create a Bootstrap page
devmode

Shiny Developer Mode
brushedPoints

Find rows of data selected on an interactive plot.
dateRangeInput

Create date range input
debounce

Slow down a reactive expression with debounce/throttle
diskCache

Create disk cache (deprecated)
dateInput

Create date input
createWebDependency

Create a web dependency
conditionalPanel

Conditional Panel
domains

Reactive domains
downloadHandler

File Downloads
downloadButton

Create a download button or link
enableBookmarking

Enable bookmarking for a Shiny application
fluidPage

Create a page with fluid layout
flowLayout

Flow layout
createRenderFunction

Implement custom render functions
freezeReactiveVal

Freeze a reactive value
getCurrentOutputInfo

Get output information
getCurrentTheme

Obtain Shiny's Bootstrap Sass theme
fillRow

Flex Box-based row/column layouts
exportTestValues

Register expressions for export in test mode
getQueryString

Get the query string / hash component from the URL
fileInput

File Upload Control
exprToFunction

Convert an expression to a function
fixedPage

Create a page with a fixed layout
fillPage

Create a page that fills the window
helpText

Create a help text element
headerPanel

Create a header panel
insertTab

Dynamically insert/remove a tabPanel
invalidateLater

Scheduled Invalidation
insertUI

Insert and remove UI objects
isolate

Create a non-reactive scope for an expression
knitr_methods

Knitr S3 methods
markdown

Insert inline Markdown
inputPanel

Input panel
icon

Create an icon
is.reactivevalues

Checks whether an object is a reactivevalues object
maskReactiveContext

Evaluate an expression without a reactive context
htmlOutput

Create an HTML output element
moduleServer

Shiny modules
isRunning

Check whether a Shiny application is running
navlistPanel

Create a navigation list panel
memoryCache

Create memory cache (deprecated)
httpResponse

Create an HTTP response object
modalDialog

Create a modal dialog UI
loadSupport

Load an app's supporting R files
navbarPage

Create a page with a top level navigation bar
passwordInput

Create a password input control
onStop

Run code after an application or session ends
outputOptions

Set options for an output object.
onBookmark

Add callbacks for Shiny session bookmarking events
onFlush

Add callbacks for Shiny session events
plotOutput

Create an plot or image output element
reactiveFileReader

Reactive file reader
reactivePoll

Reactive polling
numericInput

Create a numeric input control
reactive

Create a reactive expression
markOutputAttrs

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

Mark a function as a render function
isTruthy

Truthy and falsy values
plotPNG

Capture a plot as a PNG file.
reactiveTimer

Timer
pageWithSidebar

Create a page with a sidebar
parseQueryString

Parse a GET query string from a URL
reactiveValues

Create an object for storing reactive values
makeReactiveBinding

Make a reactive variable
radioButtons

Create radio buttons
dataTableOutput

Table output with the JavaScript DataTables library
reactlog

Reactive Log Visualizer
reactiveValuesToList

Convert a reactivevalues object to a list
reactiveConsole

Activate reactivity in the console
registerInputHandler

Register an Input Handler
runApp

Run Shiny Application
observe

Create a reactive observer
runExample

Run Shiny Example Applications
reactiveVal

Create a (single) reactive value
observeEvent

Event handler
renderPlot

Plot Output
removeInputHandler

Deregister an Input Handler
renderPrint

Text Output
addResourcePath

Resource Publishing
restoreInput

Restore an input value
runUrl

Run a Shiny application from a URL
renderCachedPlot

Plot output with cached images
safeError

Declare an error safe for the user to see
tableOutput

Table Output
reexports

Objects exported from other packages
renderUI

UI Output
registerThemeDependency

Register a theme dependency
setSerializer

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

Image file output
showModal

Show or remove a modal dialog
repeatable

Make a random number generator repeatable
shiny-package

Web Application Framework for R
shiny.appobj

Shiny App object
session

Session object
shinyUI

Create a Shiny UI handler
showTab

Dynamically hide/show a tabPanel
setBookmarkExclude

Exclude inputs from bookmarking
showBookmarkUrlModal

Display a modal dialog for bookmarking
shinyApp

Create a Shiny app object
snapshotPreprocessOutput

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

Check for required values
submitButton

Create a submit button
sidebarLayout

Layout a sidebar and main area
tabPanel

Create a tab panel
splitLayout

Split layout
showNotification

Show or remove a notification
stacktrace

Stack trace manipulation functions
sizeGrowthRatio

Create a sizing function that grows at a given ratio
runGadget

Run a gadget
updateActionButton

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

Stop the currently running Shiny app
runTests

Runs the tests associated with this Shiny app
tabsetPanel

Create a tabset panel
getShinyOption

Get or set Shiny options
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
shinyServer

Define Server Functionality
testServer

Reactive testing for Shiny server functions and modules
updateCheckboxGroupInput

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

Create a textarea input control
textInput

Create a text input control
updateTextInput

Change the value of a text input on the client
updateDateRangeInput

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

Slider Input Widget
urlModal

Generate a modal dialog that displays a URL
updateNumericInput

Change the value of a number input on the client
withMathJax

Load the MathJax library and typeset math expressions
varSelectInput

Select variables from a data frame
shinyAppTemplate

Generate a Shiny application from a template
verticalLayout

Lay out UI elements vertically
snapshotExclude

Mark an output to be excluded from test snapshots
shinyDeprecated

Print message for deprecated functions in Shiny
updateDateInput

Change the value of a date input on the client
updateSelectInput

Change the value of a select input on the client
withProgress

Reporting progress (functional API)
snapshotPreprocessInput

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

Update URL in browser's location bar
updateRadioButtons

Change the value of a radio input on the client
updateSliderInput

Update Slider Input Widget
textOutput

Create a text output element
viewer

Viewer options
useBusyIndicators

Enable/disable busy indication
wellPanel

Create a well panel
titlePanel

Create a panel containing an application title.
validate

Validate input values and other conditions
updateTextAreaInput

Change the value of a textarea input on the client
updateTabsetPanel

Change the selected tab on the client