Learn R Programming

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

shinyWidgets

Extend widgets available in shiny

Overview

This package offers custom widgets and other components to enhance your shiny applications.

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()

A live version is available here : http://shinyapps.dreamrs.fr/shinyWidgets

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"
),

...

Sweet Alert

Displays a message to the user :

See examples in ?sendSweetAlert.

Request confirmation from the user :

See examples in ?confirmSweetAlert.

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 = "myKnob",
  label = "jQuery knob example:",
  value = 0,
  min = -100,
  displayPrevious = TRUE, 
  lineCap = "round",
  fgColor = "#428BCA",
  inputColor = "#428BCA"
)

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

55,486

Version

0.5.4

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

October 6th, 2020

Functions in shinyWidgets (0.5.4)

addSpinner

Display a spinner above an output when this one recalculate
awesomeCheckbox

Awesome Checkbox Input Control
actionGroupButtons

Actions Buttons Group Inputs
animations

Animation names
appendVerticalTab

Mutate Vertical Tabset Panel
airDatepicker

Air Date Picker Input
actionBttn

Awesome action button
animateOptions

Animate options
awesomeCheckboxGroup

Awesome Checkbox Group Input Control
autonumericInput

Autonumeric Input Widget
currencyInput

Format Numeric Inputs
circleButton

Circle Action button
closeSweetAlert

Close Sweet Alert
html-dependencies

HTML dependencies
demoAirDatepicker

Some examples on how to use airDatepickerInput
demoNoUiSlider

Some examples on how to use noUiSliderInput
demoNumericRange

An example showing how numericRangeInput works
awesomeRadio

Awesome Radio Buttons Input Control
downloadBttn

colorSelectorInput

Color Selector Input
drop-menu-interaction

Interact with Drop Menu
numericRangeInput

Numeric Range Input
checkboxGroupButtons

Buttons Group checkbox Input Control
inputSweetAlert

Launch an input text dialog
knobInput

Knob Input
execute_safely

Execute an expression safely in server
chooseSliderSkin

Theme selector for sliderInput
progressSweetAlert

Progress bar in a sweet alert
radioGroupButtons

Buttons Group Radio Input Control
prettySwitch

Pretty Switch Input
prettyRadioButtons

Pretty radio Buttons Input Control
updateCurrencyInput

Update a Formatted Numeric Input Widget
prettyToggle

Pretty Toggle Input
materialSwitch

Material Design Switch Input Control
multiInput

Create a multiselect input control
dropdown

Dropdown
bootstrap-utils

Bootstrap panel / alert
dropMenuOptions

Drop menu options
dropMenu

Drop Menu
spectrumInput

Palette Color Picker with Spectrum Library
show_toast

Show a toast notification
progress-bar

Progress Bars
sweetalert-confirmation

Launch a confirmation dialog
setSliderColor

Color editor for sliderInput
setShadow

Custom shadows
prettyCheckbox

Pretty Checkbox Input
numericInputIcon

Create a numeric input control with icon(s)
noUiSliderInput

Numeric range slider
prettyCheckboxGroup

Pretty Checkbox Group Input Control
toggleDropdownButton

Toggle a dropdown menu
tooltipOptions

Tooltip options
sliderTextInput

Slider Text Input Widget
pickerGroup-module

Picker Group
sweetalert

Display a Sweet Alert to the user
updateAirDateInput

shinyWidgetsGallery

Launch the shinyWidget Gallery
shinyWidgets

shinyWidgets: Custom inputs widgets for Shiny.
updatePrettyCheckboxGroup

Change the value of a pretty checkbox on the client
updateAwesomeRadio

Change the value of a radio input on the client
updateCheckboxGroupButtons

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

Change the value pretty radio buttons on the client
updatePickerInput

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

Change the value of a pretty checkbox on the client
updateAutonumericInput

Update an Autonumeric Input Object
updateNumericInputIcon

Change the value of a numeric input icon on the client
updatePrettySwitch

Change the value of a pretty switch on the client
updatePrettyToggle

Change the value of a pretty toggle on the client
useBs4Dash

Use 'bs4Dash' in 'shiny'
dropdownButton

Dropdown Button
useShinydashboardPlus

Use 'shinydashboardPlus' in 'shiny'
updateNumericRangeInput

Change the value of a numeric range input
useShinydashboard

Use 'shinydashboard' in 'shiny'
useSweetAlert

Load Sweet Alert dependencies
updateMultiInput

Change the value of a multi input on the client
updateRadioGroupButtons

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

Bootstrap Switch Input Control
updateNoUiSliderInput

Change the value of a no ui slider input on the client
pickerInput

Select Picker Input Control
pickerOptions

Options for `pickerInput`
searchInput

Search Input
setBackgroundColor

Custom background color for your shinyapp
selectizeGroup-module

Selectize Group
setBackgroundImage

Custom background image for your shinyapp
updateAwesomeCheckbox

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

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

Change the value of a spectrum input on the client
textInputAddon

Text with Add-on Input Control
updateTextInputIcon

Change the value of a text input icon on the client
textInputIcon

Create a text input control with icon(s)
updateSwitchInput

Change the value of a switch input on the client
wNumbFormat

Format numbers in noUiSliderInput
useTablerDash

Use 'tablerDash' in 'shiny'
updateSearchInput

Change the value of a search input on the client
vertical-tab

Vertical tab panel
updateAwesomeCheckboxGroup

updateKnobInput

Change the value of a knob input on the client
updateMaterialSwitch

Change the value of a materialSwitch input on the client
updateVerticalTabsetPanel

Update selected vertical tab
useArgonDash

Use 'argonDash' in 'shiny'