• Stars
    star
    822
  • Rank 55,485 (Top 2 %)
  • Language
    R
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

shinyWidgets : Extend widgets available in shiny

shinyWidgets

Extend widgets available in shiny

version cranlogs cran checks Coverage Status AppVeyor build status R-CMD-check

Overview

This package provide 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

Install from CRAN with:

install.packages("shinyWidgets")

Or install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("dreamRs/shinyWidgets")

Demo

A gallery application is included in the package. Once installed, use the following command to launch it:

shinyWidgets::shinyWidgetsGallery()

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

Widgets

Single checkbox

  • Bootstrap switch

Turn checkboxes into toggle switches :

switchInput

switchInput(inputId = "id", value = TRUE)
  • Material switch

Turn checkboxes into toggle switches :

materialSwitch

materialSwitch(inputId = "id", label = "Primary switch", status = "danger")
  • Pretty checkbox
prettyCheckbox(
  inputId = "id", label = "Check me!", icon = icon("check")
)
  • Pretty switch
prettySwitch(
  inputId = "id",
  label = "Switch:",
  fill = TRUE, 
  status = "primary"
)
  • Pretty toggle
prettyToggle(
  inputId = "id",
  label_on = "Checked!",
  label_off = "Unchecked..."
)

Checkboxes and radio buttons

  • Bootstrap buttons

checkboxGroupButtons

checkboxGroupButtons( # or radioGroupButtons
  inputId = "id",
  label = "Choice: ",
  choices = c("A", "B", "C")
)
  • Pretty checkbox group and radio buttons
prettyCheckboxGroup( # or prettyRadioButtons
  inputId = "id",
  label = "Choice",
  choices = c("A", "B", "c"),
  outline = TRUE,
  plain = TRUE,
  status = "primary",
  icon = icon("check")
)

Select menu

  • Bootstrap select picker

Select menu with lot of configurations options available:

pickerInput

pickerInput(
  inputId = "id", 
  label = "Select:", 
  choices = month.name, 
  options = pickerOptions(
    actionsBox = TRUE, 
    size = 10,
    selectedTextFormat = "count > 3"
  ), 
  multiple = TRUE
)
  • Virtual select

Select menu that can support long list of choices:

virtualSelectInput

virtualSelectInput(
  inputId = "id",
  label = "Select:",
  choices = list(
    "Spring" = c("March", "April", "May"),
    "Summer" = c("June", "July", "August"),
    "Autumn" = c("September", "October", "November"),
    "Winter" = c("December", "January", "February")
  ),
  showValueAsTags = TRUE,
  search = TRUE,
  multiple = TRUE
)

Date picker

  • Air Datepicker

Date (or month or year) picker with lot of options and a timepicker integrated :

airDatepickerInput

airDatepickerInput(
  inputId = "id",
  label = "Select:",
  placeholder = "Placeholder",
  multiple = 5, 
  clearButton = TRUE
)

Sliders

  • Slider with Text

Slider with strings, to pass whatever you want:

sliderText

sliderTextInput(
  inputId = "id", 
  label = "Choice:", 
  grid = TRUE, 
  force_edges = TRUE,
  choices = c(
    "Strongly disagree",
    "Disagree",
    "Neither agree nor disagree", 
    "Agree", 
    "Strongly agree"
  )
)
  • noUiSlider

A range slider that can be colored, have more than two handles and positioned vertically (among other things):

noUiSliderInput

noUiSliderInput(
  inputId = "id",
  label = "Select:",
  min = 0, 
  max = 600,
  value = c(100, 220, 400),
  tooltips = TRUE,
  step = 1
)

Tree

  • Tree check

Select value(s) in a hierarchical structure:

treeInput

treeInput(
  inputId = "ID2",
  label = "Select cities:",
  choices = create_tree(cities),
  returnValue = "text",
  closeDepth = 1
)

Text

  • Search

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

search_input

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

Other functionnalities

Sweet Alert

Show an alert message to the user to provide some feedback, via sweetalert2 library:

sendSweetAlert

See examples in ?show_alert.

Request confirmation from the user :

confirmSweetAlert

See examples in ?ask_confirmation.

Dropdown button

Hide input in a button :
dropdown_off dropdown_on

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

See also ?dropMenu()

Development

This package use {packer} to manage JavaScript assets, see packer's documentation for more.

Install nodes modules with:

packer::npm_install()

Modify inputs bindings in srcjs/inputs/, then run:

packer::bundle()

Re-install R package and try functions.

More Repositories

1

esquisse

RStudio add-in to make plots interactively with ggplot2
R
1,765
star
2

fresh

Fresh shiny themes
SCSS
225
star
3

billboarder

๐Ÿ“Š R Htmlwidget for billboard.js
R
173
star
4

prefixer

Prefix function with their namespace & other development tools
R
141
star
5

apexcharter

๐Ÿ“Š R Htmlwidget for ApexCharts.js
R
139
star
6

shinybusy

Minimal busy indicator for Shiny apps
R
138
star
7

datamods

Shiny modules to import and manipulate data into an application or addin
R
138
star
8

gfonts

๐Ÿ”ค Offline Google Fonts for rmarkdown and shiny
R
112
star
9

shinyapps

Some Shiny applications
R
102
star
10

shinylogs

Logs for Shiny apps
R
95
star
11

toastui

R htmlwidgets for ToastUI libraries: grid, calendar and chart
R
80
star
12

colorscale

Create a color scale from a single color
R
80
star
13

shufflecards

โœจ Create magical grid layouts in Shiny & Markdown
R
80
star
14

r2d3maps

r2d3 experiment to draw maps in D3
R
75
star
15

tuicalendr

๐Ÿ“† R htmlwidget for tui-calendar
R
54
star
16

topogram

R htmlwidget for cartogram-chart
R
51
star
17

shinypop

Collection of notifications, confirm dialogs and alerts for 'Shiny' applications
JavaScript
51
star
18

addinit

Initialize & structure an 'RStudio' Project
R
50
star
19

viewxl

'RStudio' addin to open data.frame(s) in Excel
R
47
star
20

wired

Wired elements in Shiny
JavaScript
47
star
21

shinytreeview

Hierarchical tree input for Shiny apps
R
41
star
22

memory-hex

Hex Memory Game in Shiny
R
33
star
23

sqlquery

Htmlwidget to write SQL queries
JavaScript
31
star
24

capture

Take screenshots in Shiny apps
JavaScript
29
star
25

particlesjs

Particles.js for Shiny apps & rmarkdown
R
26
star
26

timelineschart

Htmlwidget for timelines-chart
R
26
star
27

jstools

Tools to work with JavaScript and CSS files
JavaScript
25
star
28

flexpivot

Simple frequency table
R
24
star
29

phosphoricons

Phosphor Icons for R
R
23
star
30

weather

Weather icons in ggplot2, shiny and rmarkdown
SCSS
20
star
31

where

๐Ÿ“ Cities database and a game!
R
16
star
32

d3.format

R interface for d3.format
R
16
star
33

shinyvs

Virtual Select widget for shiny apps
R
16
star
34

gridstackr

Create movable and resizable grid layout in 'Shiny' application.
R
16
star
35

resizer

Simulate screen resolution for Shiny apps
R
15
star
36

tuichartr

๐Ÿ“Š R htmlwidget for tui-chart
R
14
star
37

shinywb

Interface to WinBox JavaScript library to use in shiny applications
R
13
star
38

grillade

Grid sytem for shiny apps or rmarkdown and to create htmlwidgets matrix
R
13
star
39

rte.data

Access data from RTE API
R
10
star
40

tweets-transports

Analyse des tweets des lignes de transport parisien
R
9
star
41

bar

R Htmlwidget for proportions-chart JavaScript library
JavaScript
9
star
42

talks

๐Ÿ’ฌ Slides for dreamRs talks
5
star
43

france-power-grid

French housing connected to the electricity grid
R
5
star
44

reactwidgets

Extra React Widgets for Shiny applications
R
4
star
45

luciole

Luciole font for R. a new typeface developed explicitly for visually impaired people
R
3
star
46

nlpr.fr

Client for 'NLP.js' for Natural Language Operations in French
R
2
star
47

vchartr

R Htmlwidget for VChart charting library
R
2
star
48

uPlot-r

R htmlwidget for ยตPlot.js
R
1
star
49

rr2018addins

Exemples d'add-ins RStudio pour les rencontres R 2018
R
1
star