navbar_options: Create a set of navbar options

View source: R/navs-legacy.R

navbar_optionsR Documentation

Description

A navbar_options() object captures options specific to the appearance and behavior of the navbar, independent from the content displayed on the page. This helper should be used to create the list of options expected by navbar_options in page_navbar() and navset_bar().

Usage

navbar_options(
  ...,
  position = c("static-top", "fixed-top", "fixed-bottom"),
  bg = NULL,
  inverse = "auto",
  collapsible = TRUE,
  underline = TRUE
)

Arguments

...

Additional arguments are ignored. ... is included for future expansion on navbar_options().

position

Determines whether the navbar should be displayed at the top of the page with normal scrolling behavior ("static-top"), pinned at the top ("fixed-top"), or pinned at the bottom ("fixed-bottom"). Note that using "fixed-top" or "fixed-bottom" will cause the navbar to overlay your body content, unless you add padding, e.g.: tags$style(type="text/css", "body {padding-top: 70px;}")

bg

a CSS color to use for the navbar's background color.

inverse

Either TRUE for a light text color or FALSE for a dark text color. If "auto" (the default), the best contrast to bg is chosen.

collapsible

TRUE to automatically collapse the navigation elements into an expandable menu on mobile devices or narrow window widths.

underline

Whether or not to add underline styling to page or navbar links when active or focused.

Details

Changelog

This function was introduced in bslib v0.9.0, replacing the position, bg, inverse, collapsible and underline arguments of page_navbar() and navset_bar(). Those arguments are deprecated with a warning and will be removed in a future version of bslib.

Value

Returns a list of navbar options.

Examples

navbar_options(position = "static-top", bg = "#2e9f7d", underline = FALSE)


rstudio/bootstraplib documentation built on Dec. 16, 2024, 2:22 p.m.