bs_carousel: Create a Bootstrap carousel

View source: R/bsTools2.R

bs_carouselR Documentation

Create a Bootstrap carousel

Description

Learn more at https://getbootstrap.com/docs/5.1/components/carousel/.

Usage

bs_carousel(
  id,
  items = list(),
  carousel_attr = c(class = "carousel slide"),
  inner_attr = c(class = "carousel-inner"),
  item_attr = c(class = "carousel-item"),
  controls = TRUE
)

Arguments

id

A string, the id to use for the carousel div.

items

A list, entries should be HTML to display in the carousel.

carousel_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the carousel content.

inner_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the carousel items.

item_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping each carousel item.

controls

TRUE/FALSE, if TRUE, adds code to display arrows to click through the carousel.

Value

A string of HTML.

Examples

bs_carousel(
id = "c1",
items = list(
  h1("First slide"),
  h1("Second slide"),
  h1("Third Slide")
)
)

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

Related to bs_carousel in bsTools...