View source: R/input-dark-mode.R
input_dark_mode | R Documentation |
Creates a button that toggles between dark and light modes, specifically for toggling between light and dark Bootstrap color modes – a new feature added in Bootstrap 5.3.
input_dark_mode(..., id = NULL, mode = NULL)
toggle_dark_mode(mode = NULL, ..., session = get_current_session())
... |
Additional attributes to be passed to the input control UI, such
as In |
id |
An optional input id, required to reactively read the current color mode. |
mode |
The initial mode of the dark mode switch. By default or when set
to |
session |
A Shiny session object (the default should almost always be used). |
Returns a UI element for a dark mode switch input control. The server
value received for the input corresponding to id
will be a string value
with the current color mode ("light"
or "dark"
).
input_dark_mode()
: Create a dark mode switch input control
toggle_dark_mode()
: Programmatically toggle or set the current light
or dark color mode.
Other input controls:
input_switch()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.