0

[Previous question]How to include an action link into a button's label?

How I can align "get help" on the right of sidbarPanel?

library(shiny)

ui <- fluidPage(
  br(),
  selectInput(
    inputId = "some_id", 
    label = HTML("Please choose A or B", 
                 as.character(actionLink(inputId = 'action_link', label = 'get help'))),
    choices = c("choice A", "choice B"),
    selected = "choice A",
    selectize = F
  )
)


server <- function(input, output) {}

shinyApp(ui, server)

Jacky
  • 13
  • 2

1 Answers1

0

as far as I understand from the problem is you want a helper icon or link on the side of you select input. you can use shinyhelper library for that.For Detailed Documentation yo can refer to here

I tried a sample for using this: hope this help

library(shiny)
library(shinyhelper)
library(magrittr)

ui <- fluidPage(

  titlePanel(title = "Demo APP"),

  sidebarLayout(

    sidebarPanel = sidebarPanel(

      selectInput(inputId = "dataset", "choose DataSet",
                  choices = c("MTCARS","IRSIS")
      ) %>% 
        helper(type = "inline",
               title = "Inline Help",
               content = c("This helpfile is defined entirely in the UI!",
                           "This is on a new line.",
                           "This is some <b>HTML</b>."),
               size = "s")
    ),

    mainPanel = mainPanel(
      verbatimTextOutput(outputId = "TABLE")

    )
  )
)


server <- function(input, output) {
  observe_helpers()
  output$TABLE<-renderText({

    paste0("Dataset selcted: ",input$dataset)

  }) 
}

shinyApp(ui, server)

Output Looks like: enter image description here

after clicking the icon: enter image description here

Subhasish1315
  • 938
  • 1
  • 10
  • 25