-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrote pretty examples and changed update defaults
- Loading branch information
Showing
21 changed files
with
1,218 additions
and
943 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
library(shiny) | ||
library(shinyWidgets) | ||
|
||
ui <- fluidPage( | ||
tags$h1("Pretty checkbox"), | ||
br(), | ||
|
||
fluidRow( | ||
column( | ||
width = 4, | ||
prettyCheckbox( | ||
inputId = "checkbox1", | ||
label = "Click me!" | ||
), | ||
verbatimTextOutput(outputId = "res1"), | ||
br(), | ||
prettyCheckbox( | ||
inputId = "checkbox4", | ||
label = "Click me!", | ||
outline = TRUE, | ||
plain = TRUE, | ||
icon = icon("thumbs-up") | ||
), | ||
verbatimTextOutput(outputId = "res4") | ||
), | ||
column( | ||
width = 4, | ||
prettyCheckbox( | ||
inputId = "checkbox2", | ||
label = "Click me!", | ||
thick = TRUE, | ||
animation = "pulse", | ||
status = "info" | ||
), | ||
verbatimTextOutput(outputId = "res2"), | ||
br(), | ||
prettyCheckbox( | ||
inputId = "checkbox5", | ||
label = "Click me!", | ||
icon = icon("check"), | ||
animation = "tada", | ||
status = "default" | ||
), | ||
verbatimTextOutput(outputId = "res5") | ||
), | ||
column( | ||
width = 4, | ||
prettyCheckbox( | ||
inputId = "checkbox3", | ||
label = "Click me!", | ||
shape = "round", | ||
status = "danger", | ||
fill = TRUE, | ||
value = TRUE | ||
), | ||
verbatimTextOutput(outputId = "res3") | ||
) | ||
) | ||
|
||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
output$res1 <- renderPrint(input$checkbox1) | ||
output$res2 <- renderPrint(input$checkbox2) | ||
output$res3 <- renderPrint(input$checkbox3) | ||
output$res4 <- renderPrint(input$checkbox4) | ||
output$res5 <- renderPrint(input$checkbox5) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) | ||
|
||
|
||
|
||
|
||
# Inline example ---- | ||
|
||
ui <- fluidPage( | ||
tags$h1("Pretty checkbox: inline example"), | ||
br(), | ||
prettyCheckbox( | ||
inputId = "checkbox1", | ||
label = "Click me!", | ||
status = "success", | ||
outline = TRUE, | ||
inline = TRUE | ||
), | ||
prettyCheckbox( | ||
inputId = "checkbox2", | ||
label = "Click me!", | ||
thick = TRUE, | ||
shape = "curve", | ||
animation = "pulse", | ||
status = "info", | ||
inline = TRUE | ||
), | ||
prettyCheckbox( | ||
inputId = "checkbox3", | ||
label = "Click me!", | ||
shape = "round", | ||
status = "danger", | ||
value = TRUE, | ||
inline = TRUE | ||
), | ||
prettyCheckbox( | ||
inputId = "checkbox4", | ||
label = "Click me!", | ||
outline = TRUE, | ||
plain = TRUE, | ||
animation = "rotate", | ||
icon = icon("thumbs-up"), | ||
inline = TRUE | ||
), | ||
prettyCheckbox( | ||
inputId = "checkbox5", | ||
label = "Click me!", | ||
icon = icon("check"), | ||
animation = "tada", | ||
status = "primary", | ||
inline = TRUE | ||
), | ||
verbatimTextOutput(outputId = "res") | ||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
output$res <- renderPrint( | ||
c(input$checkbox1, | ||
input$checkbox2, | ||
input$checkbox3, | ||
input$checkbox4, | ||
input$checkbox5) | ||
) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
library(shiny) | ||
library(shinyWidgets) | ||
|
||
ui <- fluidPage( | ||
tags$h1("Pretty checkbox group"), | ||
br(), | ||
|
||
fluidRow( | ||
column( | ||
width = 4, | ||
prettyCheckboxGroup( | ||
inputId = "checkgroup1", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !") | ||
), | ||
verbatimTextOutput(outputId = "res1"), | ||
br(), | ||
prettyCheckboxGroup( | ||
inputId = "checkgroup4", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
outline = TRUE, | ||
plain = TRUE, | ||
icon = icon("thumbs-up") | ||
), | ||
verbatimTextOutput(outputId = "res4") | ||
), | ||
column( | ||
width = 4, | ||
prettyCheckboxGroup( | ||
inputId = "checkgroup2", | ||
label = "Click me!", | ||
thick = TRUE, | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
animation = "pulse", | ||
status = "info" | ||
), | ||
verbatimTextOutput(outputId = "res2"), | ||
br(), | ||
prettyCheckboxGroup( | ||
inputId = "checkgroup5", | ||
label = "Click me!", | ||
icon = icon("check"), | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
animation = "tada", | ||
status = "default" | ||
), | ||
verbatimTextOutput(outputId = "res5") | ||
), | ||
column( | ||
width = 4, | ||
prettyCheckboxGroup( | ||
inputId = "checkgroup3", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
shape = "round", | ||
status = "danger", | ||
fill = TRUE, | ||
inline = TRUE | ||
), | ||
verbatimTextOutput(outputId = "res3") | ||
) | ||
) | ||
|
||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
output$res1 <- renderPrint(input$checkgroup1) | ||
output$res2 <- renderPrint(input$checkgroup2) | ||
output$res3 <- renderPrint(input$checkgroup3) | ||
output$res4 <- renderPrint(input$checkgroup4) | ||
output$res5 <- renderPrint(input$checkgroup5) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
library(shiny) | ||
library(shinyWidgets) | ||
|
||
ui <- fluidPage( | ||
tags$h1("Pretty radio buttons"), | ||
br(), | ||
|
||
fluidRow( | ||
column( | ||
width = 4, | ||
prettyRadioButtons( | ||
inputId = "radio1", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !") | ||
), | ||
verbatimTextOutput(outputId = "res1"), | ||
br(), | ||
prettyRadioButtons( | ||
inputId = "radio4", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
outline = TRUE, | ||
plain = TRUE, | ||
icon = icon("thumbs-up") | ||
), | ||
verbatimTextOutput(outputId = "res4") | ||
), | ||
column( | ||
width = 4, | ||
prettyRadioButtons( | ||
inputId = "radio2", | ||
label = "Click me!", | ||
thick = TRUE, | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
animation = "pulse", | ||
status = "info" | ||
), | ||
verbatimTextOutput(outputId = "res2"), | ||
br(), | ||
prettyRadioButtons( | ||
inputId = "radio5", | ||
label = "Click me!", | ||
icon = icon("check"), | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
animation = "tada", | ||
status = "default" | ||
), | ||
verbatimTextOutput(outputId = "res5") | ||
), | ||
column( | ||
width = 4, | ||
prettyRadioButtons( | ||
inputId = "radio3", | ||
label = "Click me!", | ||
choices = c("Click me !", "Me !", "Or me !"), | ||
shape = "round", | ||
status = "danger", | ||
fill = TRUE, | ||
inline = TRUE | ||
), | ||
verbatimTextOutput(outputId = "res3") | ||
) | ||
) | ||
|
||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
output$res1 <- renderPrint(input$radio1) | ||
output$res2 <- renderPrint(input$radio2) | ||
output$res3 <- renderPrint(input$radio3) | ||
output$res4 <- renderPrint(input$radio4) | ||
output$res5 <- renderPrint(input$radio5) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
library(shiny) | ||
library(shinyWidgets) | ||
|
||
ui <- fluidPage( | ||
tags$h1("Pretty switches"), | ||
br(), | ||
|
||
fluidRow( | ||
column( | ||
width = 4, | ||
prettySwitch(inputId = "switch1", label = "Default:"), | ||
verbatimTextOutput(outputId = "res1"), | ||
br(), | ||
prettySwitch( | ||
inputId = "switch4", | ||
label = "Fill switch with status:", | ||
fill = TRUE, status = "primary" | ||
), | ||
verbatimTextOutput(outputId = "res4") | ||
), | ||
column( | ||
width = 4, | ||
prettySwitch( | ||
inputId = "switch2", | ||
label = "Danger status:", | ||
status = "danger" | ||
), | ||
verbatimTextOutput(outputId = "res2") | ||
), | ||
column( | ||
width = 4, | ||
prettySwitch( | ||
inputId = "switch3", | ||
label = "Slim switch:", | ||
slim = TRUE | ||
), | ||
verbatimTextOutput(outputId = "res3") | ||
) | ||
) | ||
|
||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
output$res1 <- renderPrint(input$switch1) | ||
output$res2 <- renderPrint(input$switch2) | ||
output$res3 <- renderPrint(input$switch3) | ||
output$res4 <- renderPrint(input$switch4) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) |
Oops, something went wrong.