library(shiny)
chcs <- rownames(mtcars)
ui <- fluidPage(theme = bslib::bs_theme(version = 5),
shinyWidgets::virtualSelectInput("sel1", "Select car (virtual select)",
choices = chcs,
labelRenderer = I('function(data){
return "<span style = \'font-size: 3em;\'>" + data.label + "</span>";
}')
),
selectizeInput("sel2", "Select car (selectinput)", choices = chcs,
options = list(
render = I('{
item: function(data){
return "<span style = \'color:red;\'>" + data.label + "</span>";
},
option: function(data){
return "<div style = \'color: blue;\'>" + data.label + "</div>";
}
}
')
)
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
In this example we see the use of the
labelRendereroption. I was wondering if you know whether it can be used fromvirtualSelectInput, as the option should be passed through...Non-working example with selectizeInput for reference:
Thank you!