applause::button()

Zero-Configuration Button for Adding Applause/Claps/Kudos to Web Pages

pkg.garrickadenbuie.com/applause

πŸ‘ πŸ‘ πŸ‘

Add an applause button to your blog posts, package documentation, slides and more!

πŸ™ Based entirely on the awesome applause-button library by Colin Eberhardt.

πŸ““ The other goal of this project is to demonstrate how to use HTML dependencies with the htmltools package. For a walk-through of how this package was built, check out the Dev Log.

Installation

# install.packages("remotes")
remotes::install_github("gadenbuie/applause")

Usage

The package only has one function, so don’t bother attaching it with library(). Just call applause::button() wherever you need one.

R Markdown, blogdown, xaringan, etc.

```{r applause-button, echo=FALSE}
applause::button(
  color = "#0C4047",
  width = "100px"
)
```

Shiny

library(shiny)

ui <- fluidPage(
  h2("My Awesome Shiny App"),
  applause::button()
)

server <- function(input, output, session) {
  # ...
}

shinyApp(ui, server)

Options

… Additional attributes for the <applause-button> tag
style Inline CSS styles
width The width and height of the applause button, for best results the button should be square.
color The color of the button as a valid CSS color
multiclap Should users be allowed to clap more than once?
url The URL used to track total claps, if unset the current referring page URL will be used
url_api A URL for a custom Applause button back-end API, see https://github.com/ColinEberhardt/applause-button-server for an example.