Learn R Programming

lcars (version 0.4.1)

lcarsRect: LCARS rectangle element

Description

A basic rectangle HTML element that conforms to LCARS specifications.

Usage

lcarsRect(
  text = "",
  round = c("none", "both", "left", "right"),
  decorate = c("none", "both", "left", "right"),
  color = "golden-tanoi",
  text_color = "#000000",
  title_color = color,
  text_size = 16,
  title = NULL,
  width = "100%",
  height = 30
)

lcarsPill( text = "", decorate = c("none", "both", "left", "right"), color = "golden-tanoi", text_color = "#000000", title_color = color, text_size = 16, title = NULL, width = "100%", height = 30 )

lcarsLeftPill( text = "", decorate = FALSE, color = "golden-tanoi", text_color = "#000000", title_color = color, text_size = 16, title = NULL, width = "100%", height = 30 )

lcarsRightPill( text = "", decorate = FALSE, color = "golden-tanoi", text_color = "#000000", title_color = color, text_size = 16, title = NULL, width = "100%", height = 30 )

Value

a div

Arguments

text

character, rectangle text.

round

character, sides of rectangle to round to make an LCARS pill or half pill.

decorate

character, sides of rectangle to decorate with cut pill; applicable if a given side is rounded via round. Logical for lcarsLeftPill() and lcarsRightPill().

color

rectangle color. Any hex color or a named LCARS color.

text_color

text color. Any hex color or a named LCARS color.

title_color

title color. Any hex color or a named LCARS color.

text_size

size of text in pixels.

title

optional title text to insert in blank gap in rectangle. Used for header-style rectangles.

width

a valid CSS unit.

height

a valid CSS unit.

Details

While text can be made arbitrarily large using text_size, the font size of the optional title is fixed at standard header size height = 0.5.

Examples

Run this code
if (interactive()) {

  ui <- lcarsPage(
    fluidRow(
      column(4,
        h4("Rectangle"),
        lcarsRect("Some text.", text_size = 24, width = 200),
        h4("Pill"),
        lcarsPill("Some text.", text_size = 24, width = 200)
      )
    )
  )

  server <- function(input, output) {}

  shinyApp(ui, server)
}

Run the code above in your browser using DataLab