---
title: "Button types"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Button types}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{block, type = 'rmdinfo'}
Here you may find preset Bootstrap button types. For more information, see `bsplus::bs_button()`.
Please, refer to the [Customizing buttons with css vignette](customization.html) for tips on how to further customize the buttons.
```
```{r setup}
library(downloadthis)
```
### Default
```{r example_1}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".csv",
button_label = "Download data as csv",
button_type = "default",
has_icon = TRUE,
icon = "fa fa-save"
)
```
### Primary
```{r example_2}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".xlsx",
button_label = "Download data as xlsx",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-save"
)
```
### Success
```{r example_3}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".csv",
button_label = "Download data as csv",
button_type = "success",
has_icon = TRUE,
icon = "fa fa-save"
)
```
### Info
```{r example_4}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".xlsx",
button_label = "Download data as xlsx",
button_type = "info",
has_icon = TRUE,
icon = "fa fa-save"
)
```
### Warning
```{r example_5}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".csv",
button_label = "Download data as csv",
button_type = "warning",
has_icon = TRUE,
icon = "fa fa-save"
)
```
### Danger
```{r example_6}
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".xlsx",
button_label = "Download data as xlsx",
button_type = "danger",
has_icon = TRUE,
icon = "fa fa-save"
)
```