shinymaterial (version 0.5.1)

material_switch: Create a shinymaterial switch

Description

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

Usage

material_switch(input_id, label, off_label = "", on_label = "",
  initial_value = FALSE, color = NULL)

Arguments

input_id

String. The input identifier used to access the value.

label

String. The switch label.

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 http://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".

Examples

Run this code
# NOT RUN {
material_switch(
  input_id = "example_switch",
  label = "Switch",
  off_label = "Off",
  on_label = "On",
  initial_value = TRUE,
  color = "#ef5350"
)
# }

Run the code above in your browser using DataCamp Workspace