0

我有一个简单的 shinyDashbord 应用程序,其中有一个带有侧边栏的框。我想将工具提示添加到框标题中的侧边栏图标,这样当我将鼠标悬停在图标上时,工具提示就会显示出来。那可能吗?

# Toggle a box sidebar
library(shiny)
library(bs4Dash)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    body = dashboardBody(
      box(
        height = "500px",
        width = 12,
        maximizable = T,
        solidHeader = FALSE,
        collapsible = TRUE,
        sidebar = boxSidebar(
          id = "mycardsidebar",
          width = 30,
          p("Sidebar Content")
        ) 
      ),
    ),
    sidebar = dashboardSidebar()
  ),
  server = function(input, output, session) {
  }
)

感谢任何帮助

4

1 回答 1

1

https://github.com/RinteRface/bs4Dash/issues/267有简明的文档

# Toggle a box sidebar
library(shiny)
library(bs4Dash)

sidebar <- boxSidebar(
  id = "mycardsidebar",
  width = 30,
  p("Sidebar Content")
) 

sidebar[[1]]$attribs$`data-original-title` <- "Custom tooltip display"

shinyApp(
  ui = dashboardPage(
    help = TRUE,
    header = dashboardHeader(),
    body = dashboardBody(
      box(
        height = "500px",
        width = 12,
        maximizable = T,
        solidHeader = FALSE,
        collapsible = TRUE,
        sidebar = sidebar
      ),
    ),
    sidebar = dashboardSidebar()
  ),
  server = function(input, output, session) {
  }
)

工具提示示例

于 2022-02-28T14:39:20.280 回答