# shinyWidgets
> Extend widgets available in shiny
[![Travis-CI Build Status](https://travis-ci.org/dreamRs/shinyWidgets.svg?branch=master)](https://travis-ci.org/dreamRs/shinyWidgets)
[![version](http://www.r-pkg.org/badges/version/shinyWidgets)](https://CRAN.R-project.org/package=shinyWidgets)
[![cranlogs](http://cranlogs.r-pkg.org/badges/shinyWidgets)](http://cran.rstudio.com/web/packages/shinyWidgets/index.html)
[![Coverage Status](https://img.shields.io/codecov/c/github/dreamRs/shinyWidgets/master.svg)](https://codecov.io/github/dreamRs/shinyWidgets?branch=master)
## 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 :
```r
# From CRAN
install.packages("shinyWidgets")
# From Github
# install.packages("devtools")
devtools::install_github("dreamRs/shinyWidgets")
```
Demo :
```r
shinyWidgets::shinyWidgetsGallery()
```
Or see the live version here : https://dreamrs-vic.shinyapps.io/shinyWidgets/
You can find an introduction (in french) [here](https://dreamrs.github.io/shinyWidgets/articles/intro_shinyWidgets_fr.html).
And how to construct a palette color picker [here](https://dreamrs.github.io/shinyWidgets/articles/palette_picker.html).
## Widgets available :
- [Bootstrap switch](#bootstrap-switch)
- [Material switch](#material-switch)
- [Pretty Checkbox](#pretty-checkbox)
- [Sweet Alert](#sweet-alert)
- [Slider Text](#slider-text)
- [Knob Input](#knob-input)
- [Select picker](#select-picker)
- [Checkbox and radio buttons](#checkbox-and-radio-buttons)
- [Search bar](#search-bar)
- [Dropdown button](#dropdown-button)
### Bootstrap switch
Turn checkboxes into toggle switches : <br>
![switchInput](inst/images/switchInput.png)
```r
switchInput(inputId = "id", value = TRUE)
```
### Material switch
Turn checkboxes into toggle switches (again) : <br>
![materialSwitch](inst/images/materialSwitch.png)
```r
materialSwitch(inputId = "id", label = "Primary switch", status = "danger")
```
### Pretty Checkbox
Checkbox and radio buttons with the beautiful CSS library [pretty-checkbox](https://lokesh-coder.github.io/pretty-checkbox/) :
![prettycheckbox](inst/images/pretty.png)
```r
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 :
![sendSweetAlert](inst/images/sendSweetAlert.gif)
See examples in `?sendSweetAlert`.
Request confirmation from the user :
![confirmSweetAlert](inst/images/confirmSweetAlert.gif)
See examples in `?confirmSweetAlert`.
### Slider Text
Slider with strings, to pass whatever you want : <br>
![sliderText](inst/images/sliderText.png)
```r
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](https://github.com/aterrien/jQuery-Knob) based knob, similar to sliderInput or sliderTextInput: <br>
![knobInput](inst/images/knob.gif)
```r
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 : <br>
![pickerInput](inst/images/pickerInput.png)
```r
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 : <br>
![checkboxGroupButtons](inst/images/checkboxGroupButtons.png)
```r
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 : <br>
![search_input](inst/images/search_input.png)
```r
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 : <br>
![dropdown_off](inst/images/dropdown_btn_off.png)
![dropdown_on](inst/images/dropdown_btn_on.png)
```r
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 !
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
shinyWidgets__Extend_widgets_available_in_shiny_shinyWidgets.zip (403个子文件)
font-awesome.css 37KB
bttn.min.css 32KB
font-awesome.min.css 30KB
sweetalert.css 22KB
sweetalert.css 22KB
pretty-checkbox.min.css 19KB
animate.min.css 17KB
sweetalert.min.css 15KB
spectrum.css 13KB
spectrum.min.css 10KB
awesome-bootstrap-checkbox-shiny.css 9KB
awesome-bootstrap-checkbox-shiny.css 9KB
bootstrap-slider.min.css 9KB
bootstrap-select.min.css 6KB
bootstrap-switch.min.css 6KB
bootstrap-select.min.css 6KB
bootstrap-switch.min.css 6KB
bootstrap-switch.min.css 5KB
shinyWidgets.css 5KB
nouislider.min.css 4KB
shinyWidgets.min.css 3KB
fav-button.css 3KB
fav-button.css 3KB
pkgdown.css 2KB
radioGroupButtons.css 2KB
radioGroupButtons.css 1KB
circle-button.css 1KB
multi.min.css 1KB
material-switch.css 1KB
material-switch.css 1KB
sw-dropdown.css 1006B
fav-icons.css 709B
fav-icons.css 709B
circle-button.css 668B
sw-color-selector.css 625B
checkboxGroupButtons.css 521B
styles-modules.css 476B
checkboxGroupButtons.css 466B
sw-spectrum.css 368B
multi-shiny.css 93B
DESCRIPTION 3KB
fontawesome-webfont.eot 162KB
confirmSweetAlert.gif 554KB
sendSweetAlert.gif 417KB
knob.gif 116KB
.gitignore 137B
palette_picker.html 43KB
intro_shinyWidgets_fr.html 26KB
index.html 12KB
index.html 10KB
checkboxGroupButtons.html 7KB
radioGroupButtons.html 7KB
pickerInput.html 7KB
progressBar.html 7KB
awesomeRadio.html 7KB
switchInput.html 7KB
materialSwitch.html 7KB
searchInput.html 7KB
receiveSweetAlert.html 6KB
textInputAddon.html 6KB
awesomeCheckbox.html 6KB
authors.html 6KB
updateAwesomeRadio.html 5KB
awesomeCheckboxGroup.html 5KB
updatePickerInput.html 5KB
actionGroupButtons.html 5KB
updateAwesomeCheckboxGroup.html 5KB
dropdownButton.html 5KB
updateProgressBar.html 5KB
circleButton.html 4KB
updateCheckboxGroupButtons.html 4KB
updateRadioGroupButtons.html 4KB
updateMaterialSwitch.html 4KB
tooltipOptions.html 4KB
updateSwitchInput.html 4KB
shinyWidgets.html 4KB
shinyWidgetsGallery.html 4KB
index.html 4KB
libs.html 1KB
init 18B
init 18B
mo.min.js 110KB
mo.min.js 110KB
spectrum.js 78KB
sweetalert.min.js 40KB
bootstrap-slider.min.js 35KB
bootstrap-select.min.js 33KB
bootstrap-select.min.js 33KB
spectrum.min.js 28KB
nouislider.min.js 22KB
sweetalert.min.js 17KB
sweetalert.min.js 17KB
bootstrap-switch.min.js 15KB
shinyWidgets-bindings.min.js 15KB
bootstrap-switch.min.js 15KB
bootstrap-switch.min.js 15KB
jquery.knob.min.js 11KB
wNumb.js 9KB
knob-input-binding.js 4KB
fav-button-14.js 4KB
共 403 条
- 1
- 2
- 3
- 4
- 5
资源评论
好家伙VCC
- 粉丝: 2110
- 资源: 9145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功