A non-dismissible confirmation dialog. The confirm button carries the derived
id <inputId>_confirm (a Shiny action button), so observe confirmations with
input$<inputId>_confirm. input$<inputId> is the open state.
Usage
shad_alert_dialog(
inputId,
...,
title,
description = NULL,
cancel = "Cancel",
action = "Continue",
action_variant = "default",
trigger = NULL,
class = NULL
)Arguments
- inputId
Input id.
- ...
Extra body content (between description and footer).
- title
Dialog title (required).
- description
Supporting text.
- cancel
Cancel-button label (closes only).
- action
Confirm-button label.
- action_variant
Confirm-button
shad_button()variant.- trigger
Optional tag whose click opens the dialog.
- class
Extra CSS classes.
See also
Other shadshiny tier-3 components:
shad_accordion(),
shad_carousel(),
shad_collapsible(),
shad_command(),
shad_command_palette(),
shad_context_menu(),
shad_dialog(),
shad_drawer(),
shad_dropdown_menu(),
shad_hover_card(),
shad_menu_parts,
shad_menubar(),
shad_message_scroller(),
shad_navigation_menu(),
shad_pagination(),
shad_popover(),
shad_resizable(),
shad_scroll_area(),
shad_sheet(),
shad_sidebar_layout(),
shad_tabs(),
shad_tooltip()
Examples
shad_alert_dialog("del", title = "Are you sure?",
description = "This cannot be undone.",
action = "Delete", action_variant = "destructive")
#> <div class="shad-dialog" data-shad="alert-dialog" id="del">
#> <div class="shad-dialog__overlay shad-anim-overlay" hidden></div>
#> <div class="shad-dialog__content shad-anim-dialog" hidden>
#> <div class="shad-dialog__header">
#> <div class="shad-dialog__title">Are you sure?</div>
#> <div class="shad-dialog__description">This cannot be undone.</div>
#> </div>
#> <div class="shad-dialog__footer">
#> <button type="button" class="shad-btn shad-btn--outline" data-shad-dialog-close data-shad-autofocus>Cancel</button>
#> <button type="button" class="shad-btn shad-btn--destructive action-button" id="del_confirm" data-shad-dialog-close>Delete</button>
#> </div>
#> </div>
#> </div>