Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r4fun/hover
:point_left: Hover.css Animations for 'shiny' Buttons
https://github.com/r4fun/hover
css rstats shiny
Last synced: 3 months ago
JSON representation
:point_left: Hover.css Animations for 'shiny' Buttons
- Host: GitHub
- URL: https://github.com/r4fun/hover
- Owner: r4fun
- License: other
- Created: 2020-08-02T19:46:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-19T18:31:31.000Z (over 3 years ago)
- Last Synced: 2024-08-02T07:05:33.176Z (3 months ago)
- Topics: css, rstats, shiny
- Language: R
- Homepage: https://r4fun.github.io/hover/
- Size: 198 KB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - hover - Add animations to Shiny button elements using Hover.css. (UI Components / Animation Effects)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# hover
[![R build status](https://github.com/r4fun/hover/workflows/R-CMD-check/badge.svg)](https://github.com/r4fun/hover/actions)
[![Codecov test coverage](https://codecov.io/gh/r4fun/hover/branch/master/graph/badge.svg)](https://codecov.io/gh/r4fun/hover?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/hover)](https://CRAN.R-project.org/package=hover)The goal of hover is to add animations to `shiny::actionButton`, `shiny::downloadButton`, and `shiny::icon` using [Hover.css](https://github.com/IanLunn/Hover). Additionally, a button to refresh web browser is also included.
## Installation
Install the released version of `hover` from CRAN:
```r
install.packages("hover")
```Or install the development version from GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("r4fun/hover")
```## Example
Animate a button and icon by providing the animation name:
```r
library(shiny)
library(hover)ui <- fluidPage(
use_hover(),
hover_action_button(
inputId = "btn",
label = "hello hover!",
icon = icon("refresh"),
button_animation = "rotate",
icon_animation = "spin"
)
)server <- function(input, output, session) {
}shinyApp(ui, server)
```The `hover` package essentially takes the `shiny::actionButton` source code and applies the necessary Hover.css classes to make things move.
## Acknowledgements
This package was built using the following tools:
* [Hover.css](https://github.com/IanLunn/Hover), the underlying CSS
* [shiny](https://github.com/rstudio/shiny), the source code for `hover_button`Without these, this package wouldn't have been possible.