ITADN

Multi-column layout where columns have "fr" units

#1301Closeddaattali 创建于 2026-04-06
D
daattalicommented
When building a UI, I sometimes want to do something like "create two columns where the first column takes up 400px and the second column takes up the rest of the space", or "create three buttons, where the second and third buttons take up minimal space and the first button takes up the rest". I can achieve this either with flex-grow or with the "fr" unit. Here is how I would achieve the second scenario: ``` library(shiny) ui <- bslib::page_fluid( bslib::layout_columns( style = "grid-template-columns: 1fr auto auto;", actionButton("btn1", "A"), actionButton("btn2", "B"), actionButton("btn3", "C") ) ) server <- function(input, output, session) {} shinyApp(ui, server) ``` This feels like it should be more natively supported by bslib. Is there a way to do this without resorting to custom styles/classes?
关闭于 2026-04-06 1 条评论