Description Usage Arguments Details Value Examples
Add a toggle to the shiny application that triggers all Fomantic UI elements to become "inverted"
1 | darkmode_toggle(label = "Dark Mode", ..., checked = FALSE)
|
label |
Labels to add before and after the toggle. By default "Dark Mode" will appear after the toggle |
... |
Tag attributes (named arguments) and children (unnamed arguments) |
checked |
Should the application start off in dark mode? |
To prevent elements from becoming inverted/removing their inverted state, include keep-inverted-state
to
maintain them in either standard or inverted.
A shiny.tag
that will provide a toggle style checkbox in the UI of a shiny application.
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 | if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <- semanticPage(
extendShinySemantic(),
fui_el$grid(
fui_el$row(
class = "two column",
fui_el$column(
fui_el$segment(
class = "purple",
darkmode_toggle()
)
),
fui_el$column(
fui_el$segment(
class = "red keep-inverted-state"
)
)
)
),
fui_el$cards(
class = "two",
fui_el$card(),
fui_el$card()
)
)
server <- function(input, output, session) {}
shiny::shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.