View source: R/bs_components.R
spsTitle | R Documentation |
Add a title element to UI
spsTitle(
title,
level = "2",
status = "info",
other_color = NULL,
opacity = 1,
...
)
tabTitle(
title,
level = "2",
status = "info",
other_color = NULL,
opacity = 1,
...
)
title |
string, title text |
level |
string, level of the title, the larger, the bigger, one of "1", "2", "3", "4", "5", "6" |
status |
string, one of "primary", "info", "success", "warning", "danger". This determines the color of the line. |
other_color |
string, if you do not like the default 5 status colors,
specify a valid CSS color here. If this is provided, |
opacity |
numeric, a number larger than 0 smaller than 1 |
... |
other attributes and children add to this element |
returns a shiny tag
if(interactive()) {
library(shiny)
library(magrittr)
ui <- fluidPage(
tags$b("Different status"),
c("primary", "info", "success", "warning", "danger") %>%
lapply(function(x) spsTitle(x, "4", status = x)),
tags$b("custom color"),
spsTitle("purple", "4", other_color = "purple"),
spsTitle("pink", "4", other_color = "pink"),
tags$b("Different levels"),
lapply(as.character(1:6), function(x) spsTitle(paste0("H", x), x)),
tags$b("Different opacity"),
lapply(seq(0.2, 1, 0.2), function(x) spsTitle(as.character(x), opacity = x))
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.