Title: | Generates HTML/CSS star ratings |
---|---|
Description: | Creates HTML and CSS star ratings in web documents. |
Authors: | Tan Ho [aut, cre] |
Maintainer: | Tan Ho <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-10-30 04:00:21 UTC |
Source: | https://github.com/tanho63/fivestars |
This function creates an HTML tag with the appropriate number of stars, as well as an accessibility label.
fivestars( rating, label = round(rating, 1), aria_label = paste("The rating is", round(rating, 1), "out of five stars"), label_pos = "left", star_size = NULL, star_color = NULL, star_background = NULL )
fivestars( rating, label = round(rating, 1), aria_label = paste("The rating is", round(rating, 1), "out of five stars"), label_pos = "left", star_size = NULL, star_color = NULL, star_background = NULL )
rating |
rating out of five |
label |
text to display in tag, defaults to the rating rounded to one decimal place |
aria_label |
accessibility label for text |
label_pos |
"left" or "right" - position of label relative to stars |
star_size |
CSS font-size for star background, default is to inherit from |
star_color |
CSS colour for stars, default is to inherit from |
star_background |
CSS colour for star background, default is to inherit from |
an html tag that renders a star rating out of five
use_fivestars() fivestars(3.5)
use_fivestars() fivestars(3.5)
This function adds the appropriate CSS to your page for star ratings.
use_fivestars( star_size = "larger", star_color = "#fc0", star_background = "#999" )
use_fivestars( star_size = "larger", star_color = "#fc0", star_background = "#999" )
star_size |
CSS font size for your stars, default is |
star_color |
CSS colour for star, default is |
star_background |
CSS colour for star background, default is |
HTML that inserts CSS into the page head
use_fivestars()
use_fivestars()