簡體   English   中英

如何將工具提示添加到 shinyDashbord 中的框 header 項目

[英]How to add tooltip to box header items in shinyDashbord

我有一個簡單的 shinyDashbord 應用程序,它有一個盒子,里面有一個側邊欄。 我想將工具提示添加到框 header 中的側邊欄圖標,這樣當我 hover 將鼠標懸停在圖標上時,工具提示就會顯示出來。 那可能嗎?

# 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) {
  }
)

感謝任何幫助

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) {
  }
)

工具提示示例

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM