Skip to contents

Delegates to shiny::downloadLink(), the plain-text counterpart of bs_download_button(). shiny's markup is already Bootstrap-5 clean here (no .btn-default), so this only layers on the 5.3 link utilities: color emits a .link-* colour class.

Usage

bs_download_link(id, label = "Download", ..., color = NULL, class = NULL)

Arguments

id

Output id, matching the shiny::downloadHandler() assigned to output$id.

label

Button label (text or tags).

...

Additional content and named HTML attributes, forwarded to the anchor.

color

Optional theme colour, rendered as .link-*.

class

Extra classes.

Value

An anchor tag.

Examples

bs_download_link("report", "Download the raw data")
#> <a aria-disabled="true" class="shiny-download-link disabled" download href="" id="report" tabindex="-1" target="_blank">Download the raw data</a>
bs_download_link("report", "Export", color = "danger")
#> <a aria-disabled="true" class="shiny-download-link disabled link-danger" download href="" id="report" tabindex="-1" target="_blank">Export</a>