GithubHelp home page GithubHelp logo

timelyportfolio / shinywidgets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dreamrs/shinywidgets

0.0 3.0 1.0 4.13 MB

shinyWidgets : Extend widgets available in shiny

Home Page: https://dreamrs.github.io/shinyWidgets/index.html

License: Other

R 66.65% JavaScript 23.09% CSS 10.26%

shinywidgets's Introduction

shinyWidgets

Extend widgets available in shiny

Travis-CI Build Status version cranlogs Coverage Status

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 :

# From CRAN
install.packages("shinyWidgets")

# From Github
# install.packages("devtools")
devtools::install_github("dreamRs/shinyWidgets")

Demo :

shinyWidgets::shinyWidgetsGallery()

Or see the live version here : https://dreamrs-vic.shinyapps.io/shinyWidgets/

You can find an introduction (in french) here.

And how to construct a palette color picker here.

Widgets available :

Bootstrap switch

Turn checkboxes into toggle switches :
switchInput

switchInput(inputId = "id", value = TRUE)

Material switch

Turn checkboxes into toggle switches (again) :
materialSwitch

materialSwitch(inputId = "id", label = "Primary switch", status = "danger")

Pretty Checkbox

Checkbox and radio buttons with the beautiful CSS library pretty-checkbox : prettycheckbox

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

See examples in ?sendSweetAlert.

Request confirmation from the user :

confirmSweetAlert

See examples in ?confirmSweetAlert.

Slider Text

Slider with strings, to pass whatever you want :
sliderText

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

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 :
pickerInput

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

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 :
search_input

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

And others !

shinywidgets's People

Contributors

coolbutuseless avatar divadnojnarg avatar pvictor avatar timelyportfolio avatar

Watchers

 avatar  avatar  avatar

Forkers

drroad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.