# 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 !
好家伙VCC
- 粉丝: 2313
- 资源: 9142
最新资源
- 基于Eclipse Paho Mqtt 的简单封装详细文档+全部资料.zip
- 基于electron-vue,mqtt,借鉴微信体验,支持windows,linux,mac三大平台详细文档+全部资料.zip
- 基于DuerOS的对话式物联网控制示例,采用了百度的物联网IoT Hub MQTT Server详细文档+全部资料.zip
- 基于esp8266 mqtt arduino IDE开发的系列IOT引用项目详细文档+全部资料.zip
- 基于ESP利用MQTT通信、IRext开源库实现万能红外遥控详细文档+全部资料.zip
- 基于golang和gin框架一个快速接入MQTT物联网设备的服务器详细文档+全部资料.zip
- 基于esp32-wifi实现mqtt手持测量仪详细文档+全部资料.zip
- 基于Flask框架使用MQTT进行消息互动详细文档+全部资料.zip
- 基于hyperf建立的mqtt服务端详细文档+全部资料.zip
- 基于Go语言的SiteWhere(物联网平台)服务搭建【+SDK ( JSON、REST、MQTT 通信 ) 】详细文档+全部资料.zip
- 基于Go语言实现:基于Eclipse Paho MQTT Go client、GIN框架实现ThingsBoard提供的MQTT、HTTP API详细文档+全部资料.zip
- 基于linux平台C++编写的高性能异步mqtt协议代理服务详细文档+全部资料.zip
- 基于Kotlin Multiplatform的跨平台socket通信统一接口,在对Kotlin有较好的支持的同时兼容在JAVA中调用。目前支持Android目标
- 基于mqtt.js针对egg封装的插件,可以在agent进程上稳定运行,开箱即用详细文档+全部资料.zip
- 基于Lora的物联网监管系统服务器, SSM+MySQL+MQTT详细文档+全部资料.zip
- 基于micropython可以触控和MQTT控制的按钮开关详细文档+全部资料.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈