material_switch: Create a shinymaterial switch

Description Usage Arguments See Also Examples

View source: R/shiny-material-switch.R

Description

Build a shinymaterial switch. The value is a boolean (TRUE if 'on', FALSE if 'off').

Usage

1
2
3
4
5
6
7
material_switch(
  input_id,
  off_label = "",
  on_label = "",
  initial_value = FALSE,
  color = NULL
)

Arguments

input_id

String. The input identifier used to access the value.

off_label

String. The label for the 'off' position of the switch.

on_label

String. The label for the 'on' position of the switch.

initial_value

Boolean. Is the switch initially on?

color

String. The color of the switch. Leave empty for the default color. Visit https://materializecss.com/color.html for a list of available colors. This input requires using color hex codes, rather than the word form. E.g., "#ef5350", rather than "red lighten-1".

See Also

update_material_switch

Examples

1
2
3
4
5
6
7
material_switch(
  input_id = "example_switch",
  off_label = "Off",
  on_label = "On",
  initial_value = TRUE,
  color = "#ef5350"
)

ericrayanderson/shinymaterial documentation built on Oct. 9, 2020, 5:21 p.m.