Learn R Programming

bs4Dash (version 2.3.4)

bs4Stars: AdminLTE3 stars

Description

Create a block of stars (ideal for rating)

Usage

bs4Stars(value, max = 5, color = "warning")

starBlock(value, max = 5, color = "warning")

Arguments

value

Current value. Should be positive and lower or equal to max.

max

Maximum number of stars by block.

color

Star color. Valid colors are listed below:

  • primary: bs4Dash:::rd_color_tag("#007bff").

  • secondary: bs4Dash:::rd_color_tag("#6c757d").

  • info: bs4Dash:::rd_color_tag("#17a2b8").

  • success: bs4Dash:::rd_color_tag("#28a745").

  • warning: bs4Dash:::rd_color_tag("#ffc107").

  • danger: bs4Dash:::rd_color_tag("#dc3545").

  • gray-dark: bs4Dash:::rd_color_tag("#343a40").

  • gray: bs4Dash:::rd_color_tag("#adb5bd").

  • white: bs4Dash:::rd_color_tag("#fff").

  • indigo: bs4Dash:::rd_color_tag("#6610f2").

  • lightblue: bs4Dash:::rd_color_tag("#3c8dbc").

  • navy: bs4Dash:::rd_color_tag("#001f3f").

  • purple: bs4Dash:::rd_color_tag("#605ca8").

  • fuchsia: bs4Dash:::rd_color_tag("#f012be").

  • pink: bs4Dash:::rd_color_tag("#e83e8c").

  • maroon: bs4Dash:::rd_color_tag("#d81b60").

  • orange: bs4Dash:::rd_color_tag("#ff851b").

  • lime: bs4Dash:::rd_color_tag("#01ff70").

  • teal: bs4Dash:::rd_color_tag("#39cccc").

  • olive: bs4Dash:::rd_color_tag("#3d9970").

Author

David Granjon, dgranjon@ymail.com

Examples

Run this code
if(interactive()){
 library(shiny)
 library(bs4Dash)
 
 shinyApp(
  ui = dashboardPage(
    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(
     box(
      title = "Star example",
      starBlock(5),
      starBlock(5, color = "fuchsia"),
      starBlock(1, color = "danger"),
      starBlock(3, color = "secondary")
     )
    ),
    title = "starBlock"
  ),
  server = function(input, output) { }
 )
}

Run the code above in your browser using DataLab