library("shiny")
requireNamespace("litedown", quietly = TRUE)
requireNamespace("withr", quietly = TRUE)
example_path = system.file("markdown", "modal.md", package = "bsplus")
example_markdown = withr::with_connection(
list(con = file(example_path, open = "r")), {
readLines(con)
}
)
bs_modal(id = "modal", title = "I'm a modal", body = "Yes, I am.")
bs_button("Click for modal") %>%
bs_attach_modal(id_modal = "modal")
bs_modal(
id = "modal_large",
title = "I'm a modal",
size = "large",
body = litedown::mark(text = example_markdown)
)
bs_button("Click for modal") %>%
bs_attach_modal(id_modal = "modal_large")
Run the code above in your browser using DataLab