Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanho63/fivestars
⭐⭐⭐⭐⭐ Generates HTML/CSS star ratings
https://github.com/tanho63/fivestars
Last synced: 3 months ago
JSON representation
⭐⭐⭐⭐⭐ Generates HTML/CSS star ratings
- Host: GitHub
- URL: https://github.com/tanho63/fivestars
- Owner: tanho63
- License: other
- Created: 2021-09-22T14:21:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-22T21:18:43.000Z (over 3 years ago)
- Last Synced: 2024-08-13T07:13:24.896Z (5 months ago)
- Language: R
- Homepage: https://tanho63.github.io/fivestars
- Size: 81.1 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - tanho63/fivestars - ⭐⭐⭐⭐⭐ Generates HTML/CSS star ratings (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# fivestars ⭐⭐⭐⭐⭐
[![Dev status](https://img.shields.io/github/r-package/v/tanho63/fivestars/main?label=dev%20version&style=flat-square&logo=github)](https://fivestars.dynastyprocess.com/)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html)The goal of {fivestars} is to generate star ratings with HTML and CSS.
## Installation
Install the development version from GitHub with:
```{r eval = FALSE}
install.packages("fivestars", repos = "https://tanho63.r-universe.dev")# or use remotes/devtools
# install.packages("remotes")
remotes::install_github("tanho63/fivestars")
```## Usage
```{r}
library(fivestars)
````use_fivestars()` adds the appropriate CSS and allows for some configuration of defaults (star size, colour, and background).
```{r}
use_fivestars(
star_size = "20px", # default is "larger"
star_color = "#fc0", # default
star_background = "#999" # default
)
```Minimal usage of the `fivestar` function looks like this:
```{r}
fivestars(rating = 3.5)
```
The output can be further customized with some arguments, e.g.
```{r}
fivestars(rating = 1.2,
label = "Poor",
label_pos = "right",
aria_label = "This item is rated 'Poor'",
star_color = "#d13",
star_background = "#000")
```