bs_breadcrumb: Create a Bootstrap breadcrumb

View source: R/bsTools2.R

bs_breadcrumbR Documentation

Create a Bootstrap breadcrumb

Description

Create a Bootstrap breadcrumb

Usage

bs_breadcrumb(
  items = list(),
  active = NULL,
  nav_attr = c(`aria-label` = "breadcrumb"),
  ul_attr = c(class = "breadcrumb"),
  li_attr = c(class = "breadcrumb-item"),
  a_attr = NULL
)

Arguments

items

A list, creates nav elements. If a list item is named, names should be links and values should be text to display in the nav for that link. Names will be passed to the href attribute and values to the main content of the html5::a function which will be wrapped by the html5::li function, each of which have Bootstrap classes added by default. If an item in the list is not named, the item must be valid HTML with appropriate Bootstrap classes added manually. For example, to add a drop-down, add an unnamed item to the list with HTML defining the drop-down as the value of the item.

active

A integer, the position in items to make active.

nav_attr

A named list or named vector, names are attribute names and values are attribute values. Passed to the attr parameter of html5::nav.

ul_attr

A named list or named vector, names are attribute names and values are attribute values. Passed to the attr parameter of html5::ul.

li_attr

A named list or named vector, names are attribute names and values are attribute values. Passed to the attr parameter of html5::li.

a_attr

A named list or named vector, names are attribute names and values are attribute values. Passed to the attr parameter of html5::a.

Value

A string of HTML.

Examples

bs_breadcrumb(
items = list(
  "#" = "Option 1",
  "#" = "Option 2",
  "#" = "Option 3"
),
active = 2
)

bsTools documentation built on Aug. 30, 2022, 1:08 a.m.