# Basic notice
calcite_notice(
open = TRUE,
icon = TRUE,
closable = TRUE,
title = "New feature available",
message = "Check out the reporting dashboard"
)
# Notice with specific icon and kind
calcite_notice(
open = TRUE,
kind = "danger",
icon = "exclamation-mark-triangle",
title = "Error in form",
message = "Please correct the highlighted fields"
)
# Notice with action link
calcite_notice(
open = TRUE,
icon = "layers-reference",
title = "Try this trick",
message = "Select multiple layers at once",
link = calcite_link(text = "Read more", href = "#")
)
# Shiny example with server control
if (interactive()) {
library(shiny)
ui <- calcite_shell(
calcite_panel(
heading = "Notice Demo",
calcite_notice(
id = "my_notice",
open = FALSE,
closable = TRUE,
kind = "success",
icon = TRUE,
title = "Success!",
message = "Your action completed successfully"
),
calcite_button(
id = "show_notice",
"Show Notice"
),
verbatimTextOutput("notice_status")
)
)
server <- function(input, output, session) {
observeEvent(input$show_notice$clicks, {
update_calcite("my_notice", open = TRUE)
})
output$notice_status <- renderPrint({
input$my_notice
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab