![](/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.