#' @title
#' Bulma Message
#'
#' @description
#' Colored message blocks, to emphasize part of your page.
#'
#' * `bulma_message()` - main container
#' * `bulma_message_header()` - header of the message; can be skipped
#' * `bulma_message_body()` - body of the message; must exist
#'
#' [Message](https://bulma.io/documentation/components/message/)
#'
#' @param ... (tags) content
#' @param tag default HTML tag
#'
#' @family Bulma Components
#' @name bulma_message
NULL
#' @describeIn bulma_message main container
#' @param color,size styling parameters
#' @export
bulma_message <- function(...,
color = c("primary", "link", "info",
"success", "warning", "danger",
"white", "black", "light", "dark"),
size = c("small", "normal", "medium", "large"),
tag = tags$article) {
assert_function(tag)
color <- match_arg(color)
size <- match_arg(size)
walk(tagList(...),
~assert_multi_class(., c("bulma_message_header",
"bulma_message_body")))
tag(class = "message", ...) %>%
bulma_color(color) %>%
bulma_size(size) %>%
add_class("bulma_message")
}
#' @describeIn bulma_message header; can be skipped
#' @export
bulma_message_header <- function(..., tag = tags$div) {
assert_function(tag)
tag(class = "message-header", ...) %>%
add_class("bulma_message_header")
}
#' @describeIn bulma_message body; cannot be skipped
#' @export
bulma_message_body <- function(..., tag = tags$div) {
assert_function(tag)
tag(class = "message-body", ...) %>%
add_class("bulma_message_body")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.