-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathprettySwitch.R
53 lines (46 loc) · 1.08 KB
/
prettySwitch.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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)