Skip to content

katrinabrock/shinyjsonschemaform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Generates shiny input form input based on a JSON schema structured list. Wraps react-jsonschema-form.

Example

Screenshot of a form with two fields: name and age

library(shiny)
library(shinyjsonschemaform)

schema <- list(
  title = 'My Form',
  type = 'object',
  properties = list(
    name = list(
      title = 'Name',
      type = 'string',
      default = 'Jo'
    ),
    age = list(
      title = 'Age',
      type = 'integer',
      default = 42
    )
  )
)

ui <- fluidPage(
  titlePanel("Simple Form"),
  jsonSchemaFormInput(
      "simpleForm",
      schema = schema
  ),
  verbatimTextOutput('result')
)

server <- function(input, output, session) {
  output$result <- renderText({
    paste(
      input$simpleForm$name,
      input$simpleForm$age,
      sep = '\n'
    )
  })
}

shinyApp(ui, server)

Installation

This package is not yet on CRAN. Install from github:

devtools::install_github('katrinabrock/shinyjsonschemaform', subdir = 'srcR')

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages