Custom Inputs Widgets for Shiny

Collection of custom input controls and user interface components for 'Shiny' applications. Give your applications a unique and colorful style !

Travis-CI Build Status AppVeyor build status version cranlogs cran checks Coverage Status


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
# From Github
# install.packages("devtools")

Demo :


A live version is available 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")
  inputId = "pretty_2", label = "Check me!", icon = icon("thumbs-up"), 
  status = "default", shape = "curve", animation = "pulse"
  inputId = "pretty_3", label = "Check me!", icon = icon("users"), 
  animation = "pulse", plain = TRUE, outline = TRUE
  inputId = "pretty_4", label = "Check me!",
  status = "success", outline = TRUE
  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 :

  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:

  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 :

  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 :

  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 :

  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 :
dropdown_off dropdown_on

  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 !


shinyWidgets 0.4.8

  • Remove a unit test that was not compatible with an upcoming version of Shiny.

shinyWidgets 0.4.7

  • add useArgonDash to inport functions from argonDash.
  • add useBs4Dash to import functions from bs4Dash.
  • Fix updating searchInput label & placeholder in modules.
  • Fix issue with ghost sidebar in useShinydashboard.
  • Fix issue updating prettyRadio & prettyCheckbox with icons.

shinyWidgets 0.4.5

  • Fix a bug with awesome* widgets due to FontAwesome upgrade in Shiny @AshesITR.
  • New methods for mutating vertical tabs (appendVerticalTab, removeVerticalTab, reorderVerticalTabs) by @ifellows
  • New widget numericRangeInput by @wkdavis.

shinyWidgets 0.4.4

  • New function updateMultiInput for updating multiInput, thanks to @ifellows.
  • New function updateVerticalTabsetPanel for updating verticalTabsetPanel.
  • Update options for knobInput and airDatepickerInput.
  • Custom unit & range in progress bars (arguments unit_mark & range_value in progressBar).
  • Argument update_on to choose when trigger update server-side in spectrumInput.
  • Vertical layout in selectizeGroup.
  • New function pickerOptions to help using pickerInput options argument.
  • Bug fix with size argument in actionGroupButtons.
  • dropdown button act like an actionButton (same behavior as dropdownButton)
  • Update Bootstrap-Select JavaScript library from 1.12.4 to 1.13.3 (used in pickerInput).

shinyWidgets 0.4.3

  • New functions to customize sliderInput : chooseSliderSkin and setSliderColor by @DivadNojnarg.
  • New function downloadBttn, a downloadButton with custom appearance.
  • New widget airDatepickerInput, to select single, multiple and range of dates. You can also select time. And two shortcuts to select months or years.
  • New function to add spinners when outputs are recalculating.
  • New function useShinydashboard to use functions from 'shinydashboard' into a classic 'shiny' app, specifically valueBox, infoBox and box.
  • New functions setBackgroundColor and setBackgroundImage to change background color or use an image, by @DivadNojnarg.

shinyWidgets 0.4.2

  • New function updateSearchInput to update searchInput server-side #52.
  • New argument inline to prettySwitch, prettyToggle and prettyCheckbox to position checkboxes side by side.
  • New argument html to confirmSweetAlert and sendSweetAlert to pass HTML tags in alert window #48.
  • New Shiny modules to create dependent select menu : selectizeGroup and pickerGroup.
  • New widget : noUiSlider, a minimal slider range for numeric values.

shinyWidgets 0.4.1

  • New functions with Sweet Alert : confirmSweetAlert (confirmation dialog box), inputSweetAlert (text input dialog box), progressSweetAlert (progress bar in popup).
  • Update Sweet Alert library to 2.O
  • sendSweetAlert works without using useSweetAlert in UI.
  • Update multi.js to 0.2.4
  • Update bootstrap switch to 3.3.4
  • Change minimal version of R to 3.3.1
  • Function to toggle dropdown server-side : toggleDropdownButton.

Bug fixes :

  • Fix logic on when btn-size class is added to button by @coolbutuseless.
  • Bug in dependencies between pretty* and bttn.

shinyWidgets 0.4.0

  • New widget : spectrumInput for choosing colors in palettes or custom one.
  • New widgets : prettyCheckbox, prettySwitch, prettyToggle, prettyCheckboxGroup and prettyRadioButtons for create pretty checkboxes, toggle switch, radio buttons with colors, icons and a lot of options.
  • New widget : knobInput a round slider, thanks to @DivadNojnarg.

Bug fixes:

  • Bug when initializing (in modal window or in renderUI) pickerInput and switchInput.
  • awesomeCheckboxGroup not working when inline = FALSE, thanks to @meganhartwell-stemcell, @dStudio-git, @Nicolabo to report this.
  • Weird behavior of inputs in dropdown reported by @markdumke.

shinyWidgets 0.3.6

  • New widget : sliderTextInput : a slider for character vector.
  • New arguments choiceNames & choiceValues for checkboxGroupButtons & radioGroupButtons to easily pass HTML in the names displayed on the buttons.
  • New argument inline to materialSwitch, thanks to @FrissAnalytics.

shinyWidgets 0.3.5

  • Support for bookmarking state.
  • Support for tooltip from bsplus.
  • Upgrade pickerInput to bootstrap-select 1.12.4.
  • Upgrade switchInput to bootstrap-switch 3.3.4.
  • Remove receiveSweetAlert for simpler use with useSweetAlert.
  • Add inline argument to materialSwitch (#17).
  • Display code for dropdowns in gallery.

shinyWidgets 0.3.4

This release fix a bug in the gallery and add tests.

Bug fixes

  • Fix a bug when in checkboxGroupButtons when individual = TRUE, causing shinyWidgetsGallery on launch.

shinyWidgets 0.3.3

Several updates methods implemented.

New features

  • Add function updateAwesomeCheckbox for updating single awesome checkbox.
  • New function panel to create similar panel than in shinydashboard.
  • New arguments and examples for updateSwitchInput, updateRadioGroupButtons, updateCheckboxGroupButtons, updateAwesomeRadio, updateAwesomeCheckboxGroup

Minor new features and improvements

  • Buttons in searchInput are now actionButton, see #11

shinyWidgets 0.3.2

Better documentation and examples. Alternative function to create a dropdown. New function colorSelector.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.6.2 by Victor Perrier, a month ago

Report a bug at

Browse source code at

Authors: Victor Perrier [aut, cre, cph] , Fanny Meyer [aut] , David Granjon [aut] , Ian Fellows [ctb] (Methods for mutating vertical tabs & updateMultiInput) , Wil Davis [ctb] (numericRangeInput function) , Spencer Matthews [ctb] (autoNumeric methods) , JavaScript and CSS libraries authors [ctb, cph] (All authors are listed in

Documentation:   PDF Manual  

GPL-3 license

Imports bslib, sass, shiny, htmltools, jsonlite, grDevices

Suggests shinydashboard, testthat, covr, shinydashboardPlus, bs4Dash, argonR, argonDash, tablerDash, ggplot2, DT, scales

Imported by AdhereRViz, BayesianNetwork, CaPO4Sim, GFD, LDAShiny, MDMAPR, MtreeRing, NACHO, OpenRepGrid.ic, ReviewR, SPARTAAS, ShinyQuickStarter, adepro, animaltracker, bestSDP, conmet, corporaexplorer, datacleanr, datamods, dplyrAssist, dragon, eAnalytics, editData, elaborator, esquisse, farrell, fdapaceShiny, gde, genogeographer, ggplotAssist, gimmeTools, grapesAgri1, jsmodule, matman, memapp, microhaplot, miniMeta, mipplot, mlr3shiny, naturaList, pagoo, pguIMP, polaroid, polished, powdR, rrtable, shinyML, shinyNotes, shinyhttr, shinyrecipes, subscreen, trackeRapp, wilson, wiseR.

Depended on by iSTATS.

Suggested by Clustering, OpenSpecy, PROsetta, TestDesign, compareGroups, countfitteR, eq5d, equatiomatic, fresh, geocmeans, influential, nprcgenekeepr, pkgsearch, processR, raveio, safetyGraphics, sen2r, shinyMobile, shinydashboardPlus, tablerDash, targets, visNetwork.

See at CRAN