Carousel (original) (raw)

A carousel can be useful to cycle through slides with related content. There like the accordion, there are two main functions:

The content and caption arguments can be composed using the helper functions [bs_carousel_image()](../reference/bs%5Fcarousel%5Fimage.html), which returs a centered-image tag, and[bs_carousel_caption()](../reference/bs%5Fcarousel%5Fcaption.html) with text argumentstitle and body.

bs_carousel(id = "the_beatles", use_indicators = TRUE) %>%
  bs_append(
    content = bs_carousel_image(src = "img/john.jpg", alt = "John Lennon"),
    caption = bs_carousel_caption("John Lennon", "Rhythm guitar, vocals")
  ) %>%
  bs_append(
    content = bs_carousel_image(src = "img/paul.jpg", alt = "Paul McCartney"),
    caption = bs_carousel_caption("Paul McCartney", "Bass guitar, vocals")
  ) %>%
  bs_append(
    content = bs_carousel_image(src = "img/george.jpg", alt = "George Harrison"),
    caption = bs_carousel_caption("George Harrison", "Lead guitar, vocals")
  ) %>%
  bs_append(
    content = bs_carousel_image(src = "img/ringo.jpg", alt = "Ringo Starr"),
    caption = bs_carousel_caption("Ringo Starr", "Drums, vocals")
  ) 

John Lennon

John Lennon

Rhythm guitar, vocals

Paul McCartney

Paul McCartney

Bass guitar, vocals

George Harrison

George Harrison

Lead guitar, vocals

Ringo Starr

Ringo Starr

Drums, vocals

Previous Next

Here’s another rendering of the carousel, this time: