Skip to contents

Constructs a string containing an HTML <span> element with inline CSS to render a status indicator badge.

Usage

status_to_pill(status, add_color = TRUE)

Arguments

status

character "pass", "warn" or "fail"

add_color

boolean add color

Value

status

Details

This is a helper function that translates a status string ("pass", "warn", or "fail") into a formatted HTML element. The function's primary logic is string interpolation via the glue package.

The visual appearance of the <span> is defined entirely by inline CSS and includes properties for font size, padding, background color, border, text color, and spacing.

Examples

status_to_pill("pass")
#> [1] "<span class=\"pill\" \nstyle=\"\n  background: #afe0b7ff;\n  border: 1px solid #2f6638ff;\n  color: #2f6638ff;\n\">\n  PASS\n</span>"