Learn R Programming

bsTools (version 1.0.2)

bs_card: Create a Bootstrap card

Description

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

Usage

bs_card(
  header = NULL,
  title = NULL,
  text = NULL,
  body,
  footer = NULL,
  img_src = NULL,
  img_alt = NULL,
  div_attr = c(class = "card"),
  header_attr = c(class = "card-header"),
  title_attr = c(class = "card-title"),
  text_attr = c(class = "card-text"),
  body_attr = c(class = "card-body"),
  footer_attr = c(class = "card-footer"),
  img_attr = c(class = "card-img-top"),
  header_func = h5,
  title_func = h5,
  text_func = h5
)

Value

A string of HTML.

Arguments

header

A string, the HTML to display in the header of the card.

title

A string, the HTML to display in the title of the card.

text

A string, the HTML to display in the text of the card.

body

A string, the HTML to display in the body of the card.

footer

A string, the HTML to display in the footer of the card.

img_src

A string, the path of an image to display with the card. Passed to "src" attribute of the <img> tag.

img_alt

A string, the alt attribute of an image to display with the card. Passed to "alt" attribute of the <img> tag.

div_attr

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

header_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the card header.

title_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the card title.

text_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the card text.

body_attr

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

footer_attr

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

img_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the img tag if an image is to be displayed.

header_func

A html5 function to use for the header input.

title_func

A html5 function to use for the title input.

text_func

A html5 function to use for the text input.

Examples

Run this code
bs_card(
body = "This is a card"
)

Run the code above in your browser using DataLab