rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
893 stars 300 forks source link

Dashboard body #201

Closed wenbostar closed 7 years ago

wenbostar commented 7 years ago

Hi,

Does anyone know how to remove the part of above the tab name "home"?

shiny_dashboard

Best regards! Bo

dmpe commented 7 years ago

@wenbostar could you please provide minimal example to reproduce. thanks!

wenbostar commented 7 years ago

@dmpe , Below is the code. Thanks a lot.

library(shinyjs) library("shiny") library("shinyFiles") library(DT) library(shinydashboard) library(shinythemes) library(shinysky) library(bsplus) library("htmltools")

server <- function(input, output) { output$distPlot <- renderPlot({ hist(rnorm(input$obs), col = "darkgray", border = "white") }) }

ui <- shinyUI( dashboardPage( dashboardHeader(title = "Shiny"), dashboardSidebar(),

              dashboardBody(

                  fluidRow(
                      box(width = NULL,height = NULL,
                          tabsetPanel(selected = "Result",
                                      tabPanel("Home"),
                                      tabPanel("Result"),
                                      tabPanel("Help"),
                                      tabPanel("About")

                          )
                      )
                  )
              )
)

)

shinyApp(ui = ui, server = server)

dmpe commented 7 years ago

Try overwriting .content CSS style with padding: 0px !important; (i.e. add this to styles, e.g. tags$style or something like that - dont remember exactly).

But broadly speaking, i dont know if what you try to create is a good solution, in line with AdminLTE style guidelines.

bborgesr commented 7 years ago

@dmpe's suggestion is correct. You can add the css rule directly in your app (or create a css file if you have a lot of styling to do):

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Shiny"),
  dashboardSidebar(),
  dashboardBody(
    tags$head(tags$style(HTML(".content { padding-top: 0;}"))),
    fluidRow(
      box(width = NULL, height = NULL,
        tabsetPanel(selected = "Result",
          tabPanel("Home"),
          tabPanel("Result"),
          tabPanel("Help"),
          tabPanel("About")
        )
      )
    )
  )
)

server <- function(input, output, session) {}
shinyApp(ui, server)

Also, questions of this sort (help with code) are better suited for the shiny-discuss mailing list. This issue tracker on Github is meant for users to report suspected bugs or suggest feature requests.