buttonImageInputOld: Grouped buttons with image

buttonImageInputOldR Documentation

Grouped buttons with image

Description

Create grouped buttons with image to choose a single button and get its id.

Usage

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"
)

Arguments

inputId

The input slot that will be used to access the value.

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).

Value

A group of buttons which can be controlled from the UI.

Examples

## 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)



datasketch/shinyinvoer documentation built on June 2, 2025, 2:14 a.m.