Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ColinFay/skeleton

Skeleton CSS for Shiny
https://github.com/ColinFay/skeleton

golemverse r shiny

Last synced: 9 days ago
JSON representation

Skeleton CSS for Shiny

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# skeleton

[![R-CMD-check](https://github.com/ColinFay/skeleton/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ColinFay/skeleton/actions/workflows/R-CMD-check.yaml)

The goal of skeleton is to provide [Skeleton CSS](http://getskeleton.com/) for `{shiny}`.

## Installation

You can install the development version of `{skeleton}` from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("ColinFay/skeleton")
```
# skeleton

## About

You're reading the doc about version : `r pkgload::pkg_version()`

This README has been compiled on the

```{r}
Sys.time()
```

Here are the test & coverage results :

```{r}
devtools::check(quiet = TRUE)
```

```{r eval = TRUE, message = TRUE}
covr::package_coverage()
```

# Example

## Basic app
```{r eval = FALSE}
library(shiny)
library(skeleton)

ui <- sk_page(
h1("Hello world"),
sk_row(
sk_col(6, "Hello"),
sk_col(6, "World")
),
sk_row(
plotOutput("plot1")
)
)

server <- function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars)
})
}

shinyApp(ui, server)
```

## Built-in dashboard

```{r eval = FALSE}
library(shiny)
library(skeleton)
ui <- sk_page(
sk_header(
h2("A dead simple, responsive boilerplate."),
),
sk_nav(
sk_nav_item(
id = "one",
title = "ONE",
ui = sk_row(
sk_col(
6,
"Hello plot1"
),
sk_col(
6,
plotOutput("plot1")
)
)
),
sk_nav_item(
id = "two",
title = "TWO",
ui = sk_row(
sk_col(
6,
plotOutput("plot2")
),
sk_col(
6,
"Hello plot2"
),
)
),
sk_nav_item(
id = "three",
title = "THREE",
ui = sk_row(
sk_col(
6,
plotOutput("plot3")
),
sk_col(
6,
"Hello plot3"
),
)
)
)
)
shinyApp(ui, function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars)
})
output$plot2 <- renderPlot({
plot(airquality)
})
output$plot3 <- renderPlot({
plot(pressure)
})
})
```

## With golem

You can get a boilerplate of a page or a dashboard when creating an app with golem, using the built-in golem hooks:

```{r eval = FALSE}
golem::create_golem(
"skboilerplate",
project_hook = skeleton::ghook_sk_dashboard
)
golem::create_golem(
"skdashboard",
project_hook = skeleton::ghook_sk_boilerplate
)
```