View source: R/Widget_SwitchButton.R
SwitchButton | R Documentation |
server module for UI element that changes appearance when interacted with (e.g. clicked on) and returns which appearance (state) it is currently using
SwitchButton( input, output, session, states = list(on = list(label = "", title = "it's on", icon = icon("react"), style = "background-color: #1BBF1E;"), off = list(label = "", icon = icon("react"), title = "it's off")), type = "actionButton" ) SwitchButtonUI(id)
input |
arguments necessary for use with
|
output |
arguments necessary for use with
|
session |
arguments necessary for use with
|
states |
named list of arguments to be passed to type function. NOTE: Do not provide inputId. |
type |
type of UI element, typically "actionButton" or "actionLink" |
id |
id to be used to define a namespace via |
SwitchButton
: server logic
SwitchButtonUI
: UI elements
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.