Skip to contents

Create a modal dialog using Designsystemet styles. Place ds_dialog() in your UI and open/close it from the server with show_ds_dialog() and hide_ds_dialog().

Usage

ds_dialog(..., id = NULL, class = NULL)

Arguments

...

Dialog content

id

Dialog ID for opening/closing via show_ds_dialog()

class

Additional CSS classes

Value

A Shiny tag object

Examples

ds_dialog(
  id = "my-dialog",
  ds_heading("Dialog Title", level = 2),
  ds_paragraph("Dialog content here."),
  ds_button("Close", onclick = "this.closest('dialog').close()")
)
#> <dialog id="my-dialog" class="ds-dialog">
#>   <h2 class="ds-heading">Dialog Title</h2>
#>   <p class="ds-paragraph">Dialog content here.</p>
#>   <button class="ds-button" type="button" onclick="this.closest(&#39;dialog&#39;).close()">Close</button>
#> </dialog>