add_colored_box: Add a box with specified color in an R Markdown file.

View source: R/helper_html.R

add_colored_boxR Documentation

Add a box with specified color in an R Markdown file.

Description

add_colored_box returns a box component generated by htmltools with specified color and styles.

Usage

add_colored_box(
  type = "blue-default",
  label = "",
  info = "place details here using info option",
  bgcolor = NULL,
  width = 0.5,
  halign = "c",
  top = FALSE
)

Arguments

type

One of:

  • NULL for no default color or label

  • 'blue-default' for a steel-blue box

  • 'gray-info' for a gray box

  • 'blue-info' for a blue box

  • 'green-remainder' for a green box

  • 'yellow-warning' for a yellow box

  • 'red-stop' for a red box

label

One of:

  • NULL for no label if type is NULL or using label set by type

  • A string shown on the top of box

info

A string including the main message of the box

bgcolor

NA or a length 3 vector with integer elements between 0 to 255

width

NA or a number between 0.25 to 0.95

halign

One of:

  • NA for center aligned

  • 'c' for center aligned

  • 'r' for right aligned

top

One of:

  • NA

  • FALSE for inline

  • TRUE for top-of-page

Examples

add_colored_box( type='blue-default', info='the document include information regarding...')


mtb documentation built on Oct. 21, 2022, 1:05 a.m.