Skip to contents

Renders a button that opens the modal whose id matches target, using Bootstrap's declarative data-bs-toggle="modal" attributes (no server round trip required).

Usage

bs_modal_trigger(target, ..., class = NULL)

Arguments

target

Id of the bs_modal() to open.

...

Content (label) and named HTML attributes, forwarded to bs_button().

class

Extra classes.

Value

A button tag.

Examples

bs_modal_trigger("info", "Open modal", color = "primary")
#> <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#info">Open modal</button>