A modal dialog. input$<inputId> is the open state (logical). Open/close
from the server with shad_dialog_open() / shad_dialog_close(), or supply
a trigger to open client-side with no round trip.
Usage
shad_dialog(
inputId,
...,
title = NULL,
description = NULL,
footer = NULL,
trigger = NULL,
size = NULL,
show_close = TRUE,
class = NULL
)
shad_dialog_close_button(label = "Cancel", ...)Arguments
- inputId
Input id.
- ...
For
shad_dialog_close_button(), extra attributes for the<button>.- title, description
Optional header text (auto-wired for a11y).
Optional footer content (e.g. buttons); often includes
shad_dialog_close_button().- trigger
Optional tag whose click opens the dialog.
- size
Optional CSS max-width for the content (e.g.
"40rem").- show_close
If
TRUE(default), render the top-right close button.- class
Extra CSS classes.
- label
Close-button label.
See also
shad_dialog_open(), shad_dialog_close()
Other shadshiny tier-3 components:
shad_accordion(),
shad_alert_dialog(),
shad_carousel(),
shad_collapsible(),
shad_command(),
shad_command_palette(),
shad_context_menu(),
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_dialog("edit", trigger = shad_button("Edit"),
title = "Edit profile", "Body here")
#> <div class="shad-dialog" data-shad="dialog" id="edit">
#> <button class="shad-btn shad-btn--default shad-dialog__trigger" type="button">Edit</button>
#> <div class="shad-dialog__overlay shad-anim-overlay" hidden></div>
#> <div class="shad-dialog__content shad-anim-dialog" hidden>
#> <button type="button" class="shad-dialog__close" data-shad-dialog-close aria-label="Close"><svg class="shad-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
#> <div class="shad-dialog__header">
#> <div class="shad-dialog__title">Edit profile</div>
#> </div>
#> Body here
#> </div>
#> </div>