modal | R Documentation |
Modals are a flexible alert window, which disable interaction with the page
behind them. Modals may include inputs, buttons, or simply text. Each modal
may be assigned an id
. By default hideModal()
will hide all modals, but
you may instead specify a modal's id
in which case only that modal is
closed. Additionally, when id
is not NULL
observers and reactives may
watch for the modal's close event.
modal(
id,
...,
header = NULL,
footer = NULL,
center = FALSE,
size = "md",
fade = TRUE
)
showModal(modal, session = getDefaultReactiveDomain())
closeModal(id = NULL, session = getDefaultReactiveDomain())
id |
A character string specifying the id of the modal, when closed
|
... |
Unnamed values passed as tag elements to the body of the modal. or named values passed as HTML attributes to the body element of the modal. |
header |
A character string or tag element specifying the header of the modal. |
footer |
A character string or tag element specifying the footer of the modal. |
center |
One of |
size |
One of |
fade |
One of |
modal |
A modal tag element created using |
session |
A reactive context, defaults to |
modal( id = "modal1", header = h5("Header"), p("Cras placerat accumsan nulla.") )
modal( id = "modal2", size = "lg", header = h5("More complex"), container( columns( column("Cras placerat accumsan nulla."), column("Curabitur lacinia pulvinar nibh."), column( "Aliquam posuere.", "Praesent fermentum tempor tellus." ) ) ) )
Other components:
alert()
,
badge()
,
blockquote()
,
card()
,
collapsePane()
,
d1()
,
dropdown()
,
img()
,
jumbotron()
,
navContent()
,
popover()
,
pre()
,
toast()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.