Learn R Programming

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

shinyWidgets

Extend widgets available in shiny

Overview

This package provide some custom widgets to pimp your shiny apps !

You can replace classical checkboxes with switch button, add colors to radio buttons and checkbox group, use buttons as radio or checkboxes. Each widget has an update method to change the value of an input from the server.

Installation :

# From CRAN
install.packages("shinyWidgets")

# From Github
# install.packages("devtools")
devtools::install_github("dreamRs/shinyWidgets")

Demo :

shinyWidgets::shinyWidgetsGallery()

Or see the live version here : https://dreamrs-vic.shinyapps.io/shinyWidgets/

You can find an introduction (in french) here.

And how to construct a palette color picker here.

Widgets available :

Bootstrap switch

Turn checkboxes into toggle switches :

switchInput(inputId = "id", value = TRUE)

Material switch

Turn checkboxes into toggle switches (again) :

materialSwitch(inputId = "id", label = "Primary switch", status = "danger")

Pretty Checkbox

Checkbox and radio buttons with the beautiful CSS library pretty-checkbox :

prettyCheckbox(
  inputId = "pretty_1", label = "Check me!", icon = icon("check")
),
prettyCheckbox(
  inputId = "pretty_2", label = "Check me!", icon = icon("thumbs-up"), 
  status = "default", shape = "curve", animation = "pulse"
),
prettyCheckbox(
  inputId = "pretty_3", label = "Check me!", icon = icon("users"), 
  animation = "pulse", plain = TRUE, outline = TRUE
),
prettyCheckbox(
  inputId = "pretty_4", label = "Check me!",
  status = "success", outline = TRUE
),
prettyCheckbox(
  inputId = "pretty_5", label = "Check me!",
  shape = "round", outline = TRUE, status = "info"
),

...

Slider Text

Slider with strings, to pass whatever you want :

sliderTextInput(
  inputId = "mySliderText", 
  label = "Your choice:", 
  grid = TRUE, 
  force_edges = TRUE,
  choices = c("Strongly disagree",
              "Disagree", "Neither agree nor disagree", 
              "Agree", "Strongly agree")
)

Knob Input

A jQuery based knob, similar to sliderInput or sliderTextInput:

knobInput(
  inputId = "knob6", 
  label = "Cursor mode:", 
  value = 50, 
  thickness = 0.3, 
  cursor = TRUE, 
  width = 150,
  height = 150
)

...

Select picker

Dropdown menu with a lot of options :

pickerInput(
  inputId = "myPicker", 
  label = "Select/deselect all + format selected", 
  choices = LETTERS, 
  options = list(
    `actions-box` = TRUE, 
    size = 10,
    `selected-text-format` = "count > 3"
  ), 
  multiple = TRUE
)

Checkbox and radio buttons

Turn buttons into checkbox or radio :

checkboxGroupButtons(
  inputId = "somevalue", label = "Make a choice :", 
  choices = c("Choice A", "Choice B", " Choice C", "Choice D"), 
  justified = TRUE, status = "primary",
  checkIcon = list(yes = icon("ok", lib = "glyphicon"), no = icon("remove", lib = "glyphicon"))
)

Search bar

A text input only triggered by hitting 'Enter' or clicking search button :

searchInput(
  inputId = "id", 
  label = "Enter your search :", 
  placeholder = "This is a placeholder", 
  btnSearch = icon("search"), 
  btnReset = icon("remove"), 
  width = "100%"
)

Dropdown button

Hide input in a button :

dropdownButton(
  tags$h3("List of Input"),
  selectInput(inputId = 'xcol', label = 'X Variable', choices = names(iris)),
  selectInput(inputId = 'ycol', label = 'Y Variable', choices = names(iris), selected = names(iris)[[2]]),
  sliderInput(inputId = 'clusters', label = 'Cluster count', value = 3, min = 1, max = 9),
  circle = TRUE, status = "danger", icon = icon("gear"), width = "300px",
  tooltip = tooltipOptions(title = "Click to see inputs !")
)

And others !

Copy Link

Version

Install

install.packages('shinyWidgets')

Monthly Downloads

61,113

Version

0.4.1

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Victor Perrier

Last Published

January 28th, 2018

Functions in shinyWidgets (0.4.1)

awesomeRadio

Awesome Radio Buttons Input Control
checkboxGroupButtons

Buttons Group checkbox Input Control
animateOptions

Animate options
animations

Animation names
actionBttn

Awesome action button
actionGroupButtons

Actions Buttons Group Inputs
circleButton

Circle Action button
closeSweetAlert

Close Sweet Alert
awesomeCheckbox

Awesome Checkbox Input Control
awesomeCheckboxGroup

Awesome Checkbox Group Input Control
colorSelectorInput

Color Selector Input
confirmSweetAlert

Launch a confirmation dialog
dropdown

Dropdown
dropdownButton

Dropdown Button
prettyRadioButtons

Pretty radio Buttons Input Control
prettySwitch

Pretty Switch Input
searchInput

Search Input
sendSweetAlert

Display a Sweet Alert to the user
shinyWidgets

shinyWidgets: Custom inputs widgets for Shiny.
shinyWidgetsGallery

Launch the shinyWidget Gallery
toggleDropdownButton

Toggle a dropdown menu
tooltipOptions

Tooltip options
updateSliderTextInput

Change the value of a slider text input on the client
updateSpectrumInput

Change the value of a spectrum input on the client
materialSwitch

Material Design Switch Input Control
multiInput

Create a multiselect input control
prettyCheckbox

Pretty Checkbox Input
updatePrettySwitch

Change the value of a pretty switch on the client
updatePrettyToggle

Change the value of a pretty toggle on the client
prettyToggle

Pretty Toggle Input
progressBar

Progress Bars
switchInput

Bootstrap Switch Input Control
textInputAddon

Text with Add-on Input Control
updatePickerInput

Change the value of a select picker input on the client
updatePrettyCheckbox

Change the value of a pretty checkbox on the client
inputSweetAlert

Launch an input text dialog
knobInput

Knob Input
sliderTextInput

Slider Text Input Widget
spectrumInput

Palette Color Picker with Spectrum Library
updateAwesomeRadio

Change the value of a radio input on the client
updateCheckboxGroupButtons

Change the value of a checkboxes group buttons input on the client
updateProgressBar

Update a progress bar
updateRadioGroupButtons

Change the value of a radio group buttons input on the client
panel

Create a panel
pickerInput

Select picker Input Control
progressSweetAlert

Progress bar in a sweet alert
radioGroupButtons

Buttons Group Radio Input Control
updateAwesomeCheckbox

Change the value of an awesome checkbox input on the client
updateAwesomeCheckboxGroup

Change the value of a AwesomeCheckboxGroup input on the client
updatePrettyCheckboxGroup

Change the value of a pretty checkbox on the client
updatePrettyRadioButtons

Change the value pretty radio buttons on the client
updateSwitchInput

Change the value of a switch input on the client
useSweetAlert

Load Sweet Alert dependencies
prettyCheckboxGroup

Pretty Checkbox Group Input Control
updateKnobInput

Change the value of a knob input on the client
updateMaterialSwitch

Change the value of a materialSwitch input on the client