Package 'shinyComponents'

Title: 'Shiny' Components in 'R Markdown'
Description: 'Shiny' components, stored in 'R Markdown' documents.
Authors: Garrick Aden-Buie [aut, cre]
Maintainer: Garrick Aden-Buie <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.9000
Built: 2024-11-08 03:57:29 UTC
Source: https://github.com/gadenbuie/shinyComponents

Help Index


Create A Shiny Component from an R Markdown Document

Description

Shiny Components are self-contained shiny modules or app components, defined in R Markdown documents.

Public fields

ui

The UI components. If the component contains only one unnamed ui chunk, or one ui chunk named ui, then this field is a method, otherwise it is a list of ui component methods.

server

The server components. If the component contains only one unnamed server chunk, or one server chunk named server, then this field is a method, otherwise it is a list of server component methods.

dependencies

A list of the component's HTML dependencies.

Methods

Public methods


Method new()

Initialize the Shiny Component from an R Markdown file.

Usage
ShinyComponent$new(file)
Arguments
file

Path to the R Markdown document

Returns

A new Shiny Component


Method assets()

The component's CSS, compiled SASS, and JavaScript assets.

Usage
ShinyComponent$assets()
Returns

A shiny::tagList() containing the component's CSS and JavaScript assets.


Method app()

An example app, created from the primary ui and server.

Usage
ShinyComponent$app(..., id = NULL, .ui = list(), .server = list())
Arguments
...

Additional variables added into ui and server environments, in ui, server and app methods. Otherwise, ignored.

id

The component ID, if the component is being used as Shiny module.

.ui

A list of arguments to be passed on to the ui() method.

.server

A list of arguments to be passed on to the server() method.