### ----------------------------------------------------------------- ###
### An example written by pure Shiny ----
### ----------------------------------------------------------------- ###
library(shiny)
library(shinyNotes)
### Initialize shinyNotes
#set_notes_folder_path(folder.path = tempdir())
create_notes_folder()
ui <- fluidPage(
tabsetPanel(
tabPanel("Notes",
tableOutput("notes_tbl")
),
tabPanel("New note",
icon = icon("plus-circle"),
textInput("title", label = "Title", value = ""),
textAreaInput("body", label = "Note", value = "", height = "100px"),
actionButton("save", "Save")
)
)
)
server <- function(input, output, session) {
list <- reactive({
shinyNotes:::notes_as_data_frame()
})
output$notes_tbl <- renderTable({
list()
})
title <- reactive({input$title})
body <- reactive({input$body})
observeEvent(input$save, {
new_note(
title = title(),
content = body()
)
})
}
shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.