https://github.com/RinteRface/shinyRPG
RPG CSS theme for Shiny
https://github.com/RinteRface/shinyRPG
Last synced: 4 months ago
JSON representation
RPG CSS theme for Shiny
- Host: GitHub
- URL: https://github.com/RinteRface/shinyRPG
- Owner: RinteRface
- License: other
- Created: 2021-02-13T16:22:57.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-13T20:00:54.000Z (almost 4 years ago)
- Last Synced: 2024-12-04T05:22:43.910Z (4 months ago)
- Language: R
- Size: 124 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - RinteRface/shinyRPG - RPG CSS theme for Shiny (R)
README
# shinyRPG
[](https://CRAN.R-project.org/package=shinyRPG)
[](https://www.tidyverse.org/lifecycle/#experimental)The goal of shinyRPG is to ...
## Installation
You can install the released version of shinyRPG from Github with:
``` r
remotes::install_github("RinteRface/shinyRPG")
```## Example
This is a basic example which shows the template:
``` r
library(shiny)
library(shinyRPG)ui <- rpgPage(
rpgContainer(
rpgProgress("progress", 10),
rpgButton("update", "Update slider"),
rpgSlider("slider", "Slider", 0, 100, 50, golden = TRUE),
rpgCheckbox("checkbox", "Check me!"),
rpgRadio("radio", "Choose one", names(mtcars)),
rpgSelect("variable", "Variable:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear")),
rpgSelect("variable2", "Variable 2:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear"), size = 3),
style = "framed-golden"
)
)server <- function(input, output, session) {
observe({
print(
list(
button = input$update,
slider = input$slider,
checkbox = input$checkbox,
select = input$variable,
list = input$variable2
)
)
})
observeEvent({
req(input$update > 0)
input$update
}, {
updateRpgSlider(session, "slider", 50)
updateRpgProgress("progress", color = "green")
updateRpgSelect(session, inputId = "variable2", selected = "gear")
})
observeEvent(input$slider, {
updateRpgProgress("progress", value = input$slider)
})observeEvent(c(input$checkbox, input$radio), {
if (input$checkbox) showNotification("Hello")
showNotification(input$radio)
})
}shinyApp(ui, server)
```__Note__: valid JS instances are checkbox, draggable, progress, radio, dropdown, list and slider.