rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
486 stars 58 forks source link

DT with lux theme covers the whole page. #264

Closed shalutiwari closed 3 years ago

shalutiwari commented 3 years ago

Install remotes::install_github("rstudio/DT") and then run below app. Then change the theme to Lux. It covered the whole page.


library(shiny)
library(DT)

ui <- fluidPage(
  theme = bslib::bs_theme(),
  dataTableOutput("x")
)

server <- function(input, output, session) {
   bslib::bs_themer()
  output$x <- renderDataTable({
    datatable(mtcars)
  })
}

shinyApp(ui, server)
lux-new
cpsievert commented 3 years ago

@shalutiwari I'm having difficulty replicating this -- can you consistently repro with this code cross-browser? bs_theme_preview(bs_theme(bootswatch = "lux"))

MadhulikaTanuboddi commented 3 years ago

Side note/ux issue: Notice the arrows for column sorting. They look little off. @cpsievert : Shall I file a separate issue?

cpsievert commented 3 years ago

@MadhulikaTanuboddi I'm OK with ignoring the arrows (we've got much bigger fish to fry)

Closing this as I can't seem to replicate this behavior (please reopen if you can)

dc27 commented 2 years ago

"lux" theme extends beyond the defined column width. Other versions reduced table size to fit the space (I tried "mint", "morph", "cyborg", and "sandstone".)

hopefully reproducible:

library(shiny)
library(DT)

ui <- fluidPage(
  theme = bslib::bs_theme(version = 5, bootswatch = "lux"),
  sidebarLayout(
    sidebarPanel(
      sliderInput(
        "cyls",
        "Cylinders",
        min = min(mtcars$cyl),
        max = max(mtcars$cyl),
        value = median(mtcars$cyl)
      )
    ),
    mainPanel(
      fluidRow(
        column(
          12,
          dataTableOutput("cars_table")
        )
      )
    )
  )
)

server <- function(input, output, session) {
  output$cars_table <- renderDataTable({
    dplyr::filter(mtcars, cyl == input$cyls)
  })
}

shinyApp(ui, server)

session info:

other attached packages:
bslib_0.3.1
DT_0.18    
shiny_1.7.1
github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you believe you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue.