Learn R Programming

cardargus (version 0.2.1)

create_badge: Create an SVG Badge

Description

Generate a badge similar to shields.io style with label and value. Both sides have properly rounded corners.

Usage

create_badge(
  label,
  value,
  color,
  font = "Jost",
  style = "margin:2px;",
  fontsize = 11,
  horiz_padding = 5,
  extra_right_pad = 2,
  class = "",
  shadow_offset = 2,
  corner_radius = 3,
  height = NULL,
  as_string = TRUE
)

Value

SVG string

Arguments

label

Label text (left side)

value

Value text (right side)

color

Background color for value area

font

Font family name

style

CSS style string

fontsize

Font size in pixels

horiz_padding

Horizontal padding

extra_right_pad

Extra padding on right side

class

CSS class

shadow_offset

Shadow offset in pixels

corner_radius

Corner radius for rounded rectangle

height

Minimum height (optional)

as_string

Return as character string

Examples

Run this code
create_badge("UH", "192", "white")
create_badge("Recurso Federal", "36,4 milhões", "#4CAF50")

Run the code above in your browser using DataLab