buttonImageInputOld | R Documentation |
Create grouped buttons with image to choose a single button and get its id.
buttonImageInputOld(
inputId,
label = NULL,
images = NULL,
active = NULL,
disabled = NULL,
tooltips = NULL,
path = NULL,
ncol = NULL,
nrow = NULL,
format = NULL,
highlightColor = NULL,
checkmark = FALSE,
imageStyle = list(borderColor = "black", borderSize = "0px", padding = "0", shadow =
FALSE),
class = "button-style",
classImg = "image-style"
)
inputId |
The |
images |
List of id inputs when pressing each button. |
active |
Initial button selected. |
path |
Folder where the images are stored. |
ncol |
Number of images per row. |
nrow |
Number of images per column. |
class |
Name of the class which contains the button“s style |
classImg |
class Name of the class which contains the images“ style. |
imageStyles |
Styles for the images (border, shadow, padding, background). |
A group of buttons which can be controlled from the UI.
## Not run:
## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
uiOutput('button'),
verbatimTextOutput('input_button')
)
server <- function(input, output) {
# you must crate a path in www for saving images (www/img/...)
output$button <- renderUI({
buttonImageInput(inputId = 'chosen_button',
images = c("cat", "dog", "fox"),
ncol = 2,
active = 'dog',
path = "img/")
})
# print input id when clicking
output$input_button <- renderPrint({
input$chosen_button
})
}
shinyApp(ui, server)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.