I am developing a shiny app in which I use the bslib package for theming. However, when I disable the input as shown below it becomes unreadable:
library(shiny)
library(bslib)
ui <- page_fluid(
shinyjs::useShinyjs(),
theme = bs_theme(preset = "shiny"),
selectizeInput("id1", "selection unreadable", choices = 1:3, multiple = T)
)
server <- function(input, output, session) {
observeEvent(input$id1, ignoreInit =T, {
shinyjs::disable('id1')
})
}
shinyApp(ui, server)
Is there a way I can still use bs_theme(preset = "shiny") but with a more transparent look for disabled inputs like with the default theme:
ui <- fluidPage(
shinyjs::useShinyjs(),
selectInput("id1", "selection readable", choices = 1:3, multiple = T)
)
server <- function(input, output, session) {
observeEvent(input$id1, ignoreInit =T, {
shinyjs::disable('id1')
})
}
shinyApp(ui, server)


You can overwrite the CSS style of the items under the disabled status. Or you can use the
lockmethod and define the CSS style of the items under the locked status (by default there's no particular CSS style for such items):