metroCheck: Checkbox

Description Usage Arguments Examples

View source: R/metro-inputs.R

Description

Create a customizable checkbox with support for highly used options

Usage

1
2
3
4
5
6
7
8
metroCheck(
  inputId,
  label,
  value = FALSE,
  disabled = FALSE,
  style = c("1", "2"),
  labelSide = c("left", "right")
)

Arguments

inputId

Unique input id.

label

Checkbox label.

value

Whether the checkbox is checked at start. Default to FALSE.

disabled

Whether the checkbox is disabled at start. Default to FALSE.

style

Checkbox style: either "1" (fill) or "3" (outline).

labelSide

Label side: "left" or "right".

Examples

 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
if (interactive()) {
 library(shiny)
 library(shinyMetroUi)

 shiny::shinyApp(
  ui = metroPage(
    metroCheck(
     inputId = "checkbox1",
     label = "Checkbox",
     labelSide = "right"
   ),
    metroCheck(
     inputId = "checkbox2",
     label = "Checkbox checked",
     value = TRUE,
     labelSide = "right"
    ),
    metroCheck(
     inputId = "checkbox3",
     label = "Checkbox disabled",
     disabled = TRUE,
     labelSide = "right"
    ),
    metroCheck(
     inputId = "checkbox4",
     label = "Checkbox style 2",
     style = "2",
     labelSide = "left"
    ),
  ),
  server = function(input, output) {}
 )
}

RinteRface/shinyMetroUi documentation built on Dec. 31, 2019, 8:47 a.m.