Bellow is my code: I need to click on image 1 change to tabpanel 1, when I click on image 2 tabpanel 2 is selected, clicking on image 3 tabpanel 3 is selected and so on...
ui <- fluidPage(
img(id="my_img1",src="img/hexsticker.png",style="cursor:pointer;", value = 1),
img(id="my_img2",src="img/hexsticker.png",style="cursor:pointer;", value = 2),
div(style = 'display: flex; gap: 5em; width: 500px; justify-content: space-between;',
tabsetPanel(id="navbar1",
tabPanel("tab1", p("This is tab 1"), value = 1),
tabPanel("tab2", p("This is tab 2"), value = 2)
)
)
)
server <- function(input, output,session){
observeEvent(input$my_img1,
{
updateTabsetPanel(session,
inputId = 'navbar1',
selected = input$navbar1)
})
}
shinyApp(ui,server)
I know that I can do this with shinyjs package but I need to do this with basic shiny's. Is it possible?