替代文字用于闪亮的下拉菜单

发布于 2025-01-23 06:20:35 字数 585 浏览 3 评论 0原文

如果我使用Microsoft Word,并且我将鼠标留在字体下拉菜单上悬停,则将出现此弹出式:

“

它告诉您下拉菜单的名称,它的用途和使用它的捷径。

我有一个带有下拉菜单的Rhiny应用程序,我想拥有一个类似的系统来帮助我的用户。我该怎么做?

这是一些代码可以显示我从哪里开始:

library(shiny)

ui <- fixedPage(
  # The alt-text would say "Choose from 3 options"
  fixedRow(selectInput("drop", "Features", choices = c(1,2,3))))

shinyApp(ui, server = function(input, output) {})

If I'm using Microsoft word and I leave my mouse to hover over the font dropdown menu, this popup appears:

alt text for fonts

It tells you the dropdown menu's name, what it's for and a shortcut to using it.

I have an Rshiny App with a dropdown menu, and I'd like to have a similar system to aid my users. How would I go about doing so?

Here is some code to show where I'm starting from:

library(shiny)

ui <- fixedPage(
  # The alt-text would say "Choose from 3 options"
  fixedRow(selectInput("drop", "Features", choices = c(1,2,3))))

shinyApp(ui, server = function(input, output) {})

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

離人涙 2025-01-30 06:20:35

library(shiny)
library(spsComps)
library(magrittr)
ui <- fixedPage(
    # The alt-text would say "Choose from 3 options"
    fixedRow(
        # since the dropdown will expand the element height, place on top or bottom is not ideal.
        column(
            6, 
            # use `bsPopover` for full customization
            selectInput("drop1", "Features", choices = c(1,2,3), width="50%") %>% 
                bsPopover("XX dropdown", "Choose from 3 options", "right")
        ),
        column(
            6, 
            # or the convenient function `bsPop` with preset colors
            selectInput("drop2", "Features", choices = c(1,2,3), width="50%") %>% 
                bsPop("XX dropdown", "Choose from 3 options", "left", status = "primary")
        )
    )
)

shinyApp(ui, server = function(input, output) {})

“在此处输入图像描述”

How about this

library(shiny)
library(spsComps)
library(magrittr)
ui <- fixedPage(
    # The alt-text would say "Choose from 3 options"
    fixedRow(
        # since the dropdown will expand the element height, place on top or bottom is not ideal.
        column(
            6, 
            # use `bsPopover` for full customization
            selectInput("drop1", "Features", choices = c(1,2,3), width="50%") %>% 
                bsPopover("XX dropdown", "Choose from 3 options", "right")
        ),
        column(
            6, 
            # or the convenient function `bsPop` with preset colors
            selectInput("drop2", "Features", choices = c(1,2,3), width="50%") %>% 
                bsPop("XX dropdown", "Choose from 3 options", "left", status = "primary")
        )
    )
)

shinyApp(ui, server = function(input, output) {})

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文