library(shiny)
## shinyUI
ui <- fluidPage(
## make title
titlePanel("Text Demonstration"),
br(), ## just a little space for visual ease
## make Main
mainPanel(
## one row w/ 3 cols
fluidRow(
## col 1 - label for col 2
column(3, HTML("<h4>1. Find Name</h4>")),
## col 2 - input
column(4, textInput(inputId = "inputText", width = "400px",label = NULL,
placeholder = "e.g., John, Jane, etc.")
),
## col 3 - make button
actionButton(inputId = "go", label = "Go!")
),
## row two, display output
fluidRow(column(3, textOutput("outputText")))
)
)
## server
server <- (function(input, output){
## make observe event
observeEvent(input$go,{
## render Text
output$outputText <- renderText({
out <- paste0("You've entered: ", input$inputText)
return(out)
})
})
})
## runApp
shinyApp(ui = ui, server = server)
Hope that helps.