bs_card {bsTools}R Documentation

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,
  img_left = FALSE,
  img_right = FALSE,
  img_col_attr = c(class = "col-md-6"),
  body_col_attr = c(class = "col-md-6"),
  img_horizontal_attr = c(class = "img-fluid")
)

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.

img_left

TRUE/FALSE, if TRUE, places the image on the left of the card

img_right

TRUE/FALSE, if TRUE, places the image on the right of the card

img_col_attr

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

body_col_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the column containing the body if an image is to be displayed horizontally.

img_horizontal_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 horizontally.

Value

A string of HTML.

Examples

bs_card(
body = "This is a card"
)

[Package bsTools version 1.0.5 Index]