On clicking the “Click Me!” button, I should see a popover with the selectInput widget. But it is not working. Could anyone let me know as why this is not working?
<code>ui <- basicPage(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
</code>
<code>ui <- basicPage(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
</code>
ui <- basicPage(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
1
I don’t know why the popover is not showing but when you are using bslib
package try to use everything from the same package. shiny
and bslib
don’t work very well together.
If you replace basicPage
from shiny
with any page_*
function from bslib
it should work.
<code>library(shiny)
library(bslib)
ui <- page_fluid(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
</code>
<code>library(shiny)
library(bslib)
ui <- page_fluid(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
</code>
library(shiny)
library(bslib)
ui <- page_fluid(
mainPanel(
popover(
shiny::actionButton("btn_1","Click Me!"),
selectInput('Species', 'Select Species', as.character(unique(iris$Species))),
title = "Plot settings"
),
plotOutput("plt")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
0