这个答案可能不是您最初想要的,但它仍然可能对您有用。
您说您想要标签旁边的工具提示问号,所以我将其放入标签中。正确对齐。
其次,您希望工具提示在再次单击按钮之前不会打开,因为这很烦人。弹出窗口选项“焦点”可能适合您。
## app.R ##
library(shiny)
library(shinydashboard)
library(shinyBS)
# Header
header <- dashboardHeader()
# Sidebar
sidebar <- dashboardSidebar(
fileInput("chosenfile",
label = h4("File input ",
tags$style(type = "text/css", "#q1 {vertical-align: top;}"),
bsButton("q1", label = "", icon = icon("question"), style = "info", size = "extra-small")
),
accept = ".csv"),
bsPopover(id = "q1", title = "Tidy data",
content = paste0("You should read the ",
a("tidy data paper",
href = "http://vita.had.co.nz/papers/tidy-data.pdf",
target="_blank")
),
placement = "right",
trigger = "focus",
options = list(container = "body")
)
)
# Body
body <- dashboardBody()
# ui
ui <- dashboardPage(header, sidebar, body)
# server
server <- function(input, output) {}
# run
shinyApp(ui, server)