bs_carousel {bsTools}R 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")
)
)

[Package bsTools version 1.0.5 Index]