在 R Shiny 中扩大通知弹出窗口?

Posted

技术标签:

【中文标题】在 R Shiny 中扩大通知弹出窗口?【英文标题】:Widen notification popup in R Shiny? 【发布时间】:2021-06-07 13:14:07 【问题描述】:

如何在 R Shiny 中扩大通知范围?现在它正在切断更长的错误消息。

library(shiny)

ui <- fluidPage(
  actionButton("test", "Test")
)

server <- function(input, output, session) 
  observeEvent(input$test, 
      showNotification("You did it! Now make me wider", type = "message")
  )


shinyApp(ui, server)

【问题讨论】:

【参考方案1】:

CSS 调整闪亮通知的宽度

/* Put shiny notifications front and center */
#shiny-notification-panel 
  top: 0;
  bottom: unset;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 450px;

【讨论】:

以上是关于在 R Shiny 中扩大通知弹出窗口?的主要内容,如果未能解决你的问题,请参考以下文章