Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs_vars_nav

Bootstrap nav variables


Description

Those variables can be used to customize navs (e.g. shiny::tabsetPanel or shiny::navlistPanel) in Bootstrap and Bootswatch themes.

Usage

bs_vars_nav(
  link_padding = NULL,
  link_hover_bg = NULL,
  disabled_link_color = NULL,
  disabled_link_hover_color = NULL
)

Arguments

link_padding

Padding for links (tabset's titles).

link_hover_bg

Link hover background color.

disabled_link_color

Disabled link color.

disabled_link_hover_color

Disabled link hover color.

Value

a list that can be used in create_theme.

Note

See bs_vars_pills and bs_vars_tabs for more options.

Examples

# Change color of tabset when hovered
bs_vars_nav(
  link_padding = "30px 45px",
  link_hover_bg = "#FF0000"
)

if (interactive()) {
  library(shiny)
  library(fresh)

  ui <- fluidPage(

    use_theme(create_theme(
      theme = "default",
      bs_vars_nav(
        link_padding = "30px 45px",
        link_hover_bg = "#FF0000"
      )
    )),

    tags$h1("State variables"),
    fluidRow(
      column(
        width = 6,
        navlistPanel(
          "Header",
          tabPanel("First"),
          tabPanel("Second"),
          tabPanel("Third")
        )
      ),
      column(
        width = 6,
        tabsetPanel(
          tabPanel("Plot", plotOutput("plot")),
          tabPanel("Summary", verbatimTextOutput("summary")),
          tabPanel("Table", tableOutput("table"))
        )
      )
    )
  )

  server <- function(input, output, session) {

  }

  shinyApp(ui, server)
}

fresh

Create Custom 'Bootstrap' Themes to Use in 'Shiny'

v0.2.0
GPL-3
Authors
Victor Perrier [aut, cre, cph], Fanny Meyer [aut], Thomas Park [ctb, cph] (Bootswatch themes), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), onkbear [ctb, cph] (admin-lte-2-sass), Colorlib [ctb, cph] (AdminLTE)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.