'How to have a user input text and create a list with shiny? R

I have the following app which allows for text to be entered and it is then saved as VALUE and printed on a panel.

enter image description here

Although it looks like I can only do this with one text input at a time - even if I click add (so I don't believe this button is working). On top of that I would like for the user to be able to add multiple inputs (like I have below).

enter image description here

And then my VALUE function should be list with multiple inputs.

code below

library(shiny)


ui <- fluidPage(
  headerPanel("R Package App"),
  
  sidebarPanel(
    #  selectInput("options", "options", choices=c('abc','def')),
    textInput("textbox", "Enter R Package Name", ""),
    actionButton("add","Add")
  ),
  
  mainPanel(
    textOutput("caption")
  )
)
server <- function(input, output, session) {
  observe({
    VALUE <- ''
    if(input$add>0) {
      isolate({
        VALUE <- input$textbox
      })
    }
    updateTextInput(session, inputId = "textbox", value = VALUE)
  })
  
  output$caption <- renderText({
    input$textbox
  })
}

shinyApp(ui = ui, server = server)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source