Title: | 'Lit' Components for 'Shiny' |
---|---|
Description: | 'Lit' components for 'Shiny'. |
Authors: | John Coene [aut, cre] |
Maintainer: | John Coene <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.1.9000 |
Built: | 2024-10-31 04:50:35 UTC |
Source: | https://github.com/devOpifex/litter |
Create an action button.
litActionButton( name = "", content = "Click me", ..., id = NULL, class = NULL, value = NULL, callback = NULL, send_on_render = FALSE )
litActionButton( name = "", content = "Click me", ..., id = NULL, class = NULL, value = NULL, callback = NULL, send_on_render = FALSE )
name |
Name of the input. |
content |
Content of the button, a character string
or valid |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
value |
Value of the input. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
library(shiny) ui <- fluidPage( litActionButton( "btn", "First btn" ), litActionButton( "btn", "Second btn" ) ) server <- function(input, output, session){ observeEvent(input$btn, { print(input$btn) }) } if(interactive()) shinyApp(ui, server)
library(shiny) ui <- fluidPage( litActionButton( "btn", "First btn" ), litActionButton( "btn", "Second btn" ) ) server <- function(input, output, session){ observeEvent(input$btn, { print(input$btn) }) } if(interactive()) shinyApp(ui, server)
Create an action button.
litActionLink( name = "", content = "Click me", ..., id = NULL, class = NULL, value = NULL, callback = NULL, send_on_render = FALSE )
litActionLink( name = "", content = "Click me", ..., id = NULL, class = NULL, value = NULL, callback = NULL, send_on_render = FALSE )
name |
Name of the input. |
content |
Content of the button, a character string
or valid |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
value |
Value of the input. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
library(shiny) ui <- fluidPage( litActionLink( "btn", "First btn" ), litActionLink( "btn", "Second btn" ) ) server <- function(input, output, session){ observeEvent(input$btn, { print(input$btn) }) } if(interactive()) shinyApp(ui, server)
library(shiny) ui <- fluidPage( litActionLink( "btn", "First btn" ), litActionLink( "btn", "Second btn" ) ) server <- function(input, output, session){ observeEvent(input$btn, { print(input$btn) }) } if(interactive()) shinyApp(ui, server)
Create checkboxes input.
litCheckboxesInput( name = "", choices = list(), ..., id = NULL, value = list(), class = NULL, callback = NULL, send_on_render = TRUE )
litCheckboxesInput( name = "", choices = list(), ..., id = NULL, value = list(), class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
choices |
List of options. |
... |
Passed to props. |
id |
Id of the input. |
value |
|
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a color input.
litColorInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litColorInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
value |
Value of the input. |
placeholder |
Placeholder text. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render |
Create a datalist input.
litDatalistInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, placeholder = NULL, callback = NULL, send_on_render = TRUE )
litDatalistInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, placeholder = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
choices |
List of options. |
... |
Passed to props. |
id |
Id of the input. |
value |
Value of the input. |
class |
Any additional classes. |
placeholder |
Placeholder value. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Can be server-side rendered with update_datalist_input()
.
Create a filter input.
litFilterInput( name = "", ..., dataset = NULL, id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litFilterInput( name = "", ..., dataset = NULL, id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
... |
Passed to props. |
dataset |
Dataset to retrieve variables. |
id |
Id of the input. |
value |
Value of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a password input.
litPasswordInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
litPasswordInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
name |
Name of the input. |
value |
Value of the input. |
placeholder |
Placeholder text. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
send_on |
Whether to send the input when the user hits the enter key or to send it in a deferred manner. |
Create radio input.
litRadioInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litRadioInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
choices |
List of options. |
... |
Passed to props. |
id |
Id of the input. |
value |
|
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a range input.
litRangeInput( name = "", ..., id = NULL, min = 0L, max = 10L, step = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litRangeInput( name = "", ..., id = NULL, min = 0L, max = 10L, step = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
... |
Passed to props. |
id |
Id of the input. |
min , max , value
|
Minimum, maximum, and initial value of the range. |
step |
Incremental steps the range must take. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
library(shiny) ui <- fluidPage( litRangeInput("range") ) server <- function(input, output, session){ observeEvent(input$range, { print(input$range) }) } if(interactive()) shinyApp(ui, server)
library(shiny) ui <- fluidPage( litRangeInput("range") ) server <- function(input, output, session){ observeEvent(input$range, { print(input$range) }) } if(interactive()) shinyApp(ui, server)
Create a select input.
litSelectInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litSelectInput( name = "", choices = list(), ..., id = NULL, value = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
choices |
List of options. |
... |
Passed to props. |
id |
Id of the input. |
value |
Value of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a selectize input.
litSelectizeInput( name = "", choices = list(), ..., id = NULL, value = list(), class = NULL, callback = NULL, send_on_render = TRUE )
litSelectizeInput( name = "", choices = list(), ..., id = NULL, value = list(), class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
choices |
List of options. |
... |
Passed to props. |
id |
Id of the input. |
value |
Value of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a switch input.
litSwitchInput( name = "", value = TRUE, label = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litSwitchInput( name = "", value = TRUE, label = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
value |
Value of the input. |
label |
Label of the button. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a text area input.
litTextAreaInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
litTextAreaInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE )
name |
Name of the input. |
value |
Value of the input. |
placeholder |
Placeholder text. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
Create a text input.
litTextInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
litTextInput( name = "", value = "", placeholder = "", ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
name |
Name of the input. |
value |
Value of the input. |
placeholder |
Placeholder text. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on connect. |
send_on |
Whether to send the input when the user hits the enter key or to send it in a deferred manner. |
Create a text input with a floating label.
litTextLabelInput( name = "", label, value = "", placeholder = label, ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
litTextLabelInput( name = "", label, value = "", placeholder = label, ..., id = NULL, class = NULL, callback = NULL, send_on_render = TRUE, send_on = c("deferred", "enter") )
name |
Name of the input. |
label |
Label of the input. |
value |
Value of the input. |
placeholder |
Placeholder text. |
... |
Passed to props. |
id |
Id of the input. |
class |
Any additional classes. |
callback |
A JavaScript callback functions that accepts one argument. |
send_on_render |
Whether to send the input value on render. |
send_on |
Whether to send the input when the user hits the enter key or to send it in a deferred manner. |
Create an input that is initially hidden but revealed on click. This hijacks the original input which no longer sends values to the server.
litTogglerInput(name, display, input, ..., callback = NULL, restore = TRUE)
litTogglerInput(name, display, input, ..., callback = NULL, restore = TRUE)
name |
Name of the input. |
display |
The content to display. |
input |
The |
... |
Passed to props. |
callback |
A JavaScript callback functions that accepts one argument. |
restore |
Whether to set the input |
This can be updated with the feedback
argument in update_input()
as well as accept
, a boolean to indicate whether to accept the value set.
Update inputs.
update_input( ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_datalist_input( choices, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_selectize_input( choices, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_filter_input( dataset, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() )
update_input( ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_datalist_input( choices, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_selectize_input( choices, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() ) update_filter_input( dataset, ..., name = NULL, id = NULL, selector = NULL, session = shiny::getDefaultReactiveDomain() )
... |
Props to update, e.g.: |
name |
Name of the input. |
id |
Id of the input. |
selector |
A CSS selector. |
session |
A Shiny session. |
choices |
Vector (optionally named) of options. |
dataset |
Dataset to update |
Set either of name
, id
, or selector
.
The function update_datalist_input()
is used to server-side
render the options.