![](/img/trans.png)
[英]Navbar height when Including input through `bslib` helper functions in R Shiny
[英]Set R shiny modal width when theme is defined by bslib
当 bs_theme() 处于活动状态时,如何将模态宽度设置为 80%? bs_theme() 中是否有可能? 我只是无法正确使用标签。
library(shiny)
library(bslib)
ui <- fluidPage(
shiny::bootstrapLib(),
theme = bs_theme(
version = 4,
bootswatch = "minty"),
tags$style(".modal-dialog{width: 80% !important;}"),
actionButton("open_modal", "open modal"),
)
server <- function(input, output) {
observeEvent(input$open_modal, {
showModal(
modalDialog(
title = "This modal isn't 80% wide")
)
})
}
shinyApp(ui = ui, server = server)
使用tags$style(".modal-dialog {max-width: 80vw;}")
代替。 它确保您的模态始终占整个 window 的 80%,并在您更改 window 大小时自动调整大小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.