Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background color in tabsetPanel in Shiny

Tags:

css

r

shiny

How can I get a white background in tabsetPanel. For better understanding of my problem I'll bring up an example:

In my ui.R file I have the following:

mainPanel( wellPanel(wellPanel(plotOutput("densityPlot", height="500px"))), 
                               wellPanel(tabsetPanel(type = "tabs", 

        tabPanel(h5("Text1"),p("Text" )),
        tabPanel(h5("Text2"), p("Text") ),                   
        tabPanel(h5("Text3"), p("Text"))),
        br(),
        br(),
        br()                           
    ))

To make it more clear please have a look at the picture below: enter image description here

The difference is the white background area inside of any tagPanel. This combination of grey and white is the problem. Has anyone an idea, how can I get such a tagPanals.

like image 937
And_R Avatar asked Jun 27 '14 19:06

And_R


1 Answers

Use a style option on the wellPanel:

runApp(list(
  ui = fluidPage(
    titlePanel("Hello Shiny!"),
    sidebarLayout(
      sidebarPanel(
        numericInput('n', 'Number of obs', 100)
      ),
      mainPanel( wellPanel(wellPanel(plotOutput("densityPlot", height="500px"))), 
                 wellPanel(style = "background-color: #ffffff;", tabsetPanel(type = "tabs", 

                                       tabPanel(h5("Text1"),p("Text" )),
                                       tabPanel(h5("Text2"), p("Text") ),                   
                                       tabPanel(h5("Text3"), p("Text"))),
                           br(),br(),br()                           
                 ))
    )
  )
  ,
  server = function(input, output) {
    output$densityPlot <- renderPlot({ hist(runif(input$n)) })
  }
))

enter image description here

like image 176
jdharrison Avatar answered Nov 10 '22 02:11

jdharrison