spsHr: Create a horizontal line

Description Usage Arguments Details Value Examples

View source: R/bs_components.R

Description

Create a horizontal line of your choice

Usage

1
2
3
4
5
6
7
spsHr(
  status = "info",
  width = 0.5,
  other_color = NULL,
  type = "solid",
  opacity = 1
)

Arguments

status

string, one of "primary", "info", "success", "warning", "danger". This determines the color of the line.

width

numeric, how wide should the line be, a number larger than 0

other_color

string, if you do not like the default 5 status colors, specify a valid CSS color here. If this is provided status will be ignored.

type

string, one of "solid", "dotted", "dashed", "double", "groove", "ridge", "inset", "outset"

opacity

numeric, a number larger than 0 smaller than 1

Details

Read more about type here: https://www.w3schools.com/css/css_border.asp

Value

HTML <hr> element

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if(interactive()) {
  library(shiny)
  library(magrittr)
  ui <- fluidPage(
    tags$b("Different status"),
    spsHr("info"),
    spsHr("primary"),
    spsHr("success"),
    spsHr("warning"),
    spsHr("danger"),
    tags$b("custom color"),
    spsHr(other_color = "purple"),
    spsHr(other_color = "pink"),
    tags$b("Different width"),
    lapply(1:5, function(x) spsHr(width = x)),
    tags$b("Different type"),
    c("solid", "dotted", "dashed", "double", "groove", "ridge", "inset", "outset") %>%
      lapply(function(x) spsHr(type = x, width = 3)),
    tags$b("Different opacity"),
    lapply(seq(0.2, 1, 0.2), function(x) spsHr(opacity = x))
  )
  server <- function(input, output, session) {}
  shinyApp(ui, server)
}

spsComps documentation built on Feb. 3, 2022, 1:07 a.m.