## In ui.R
## Create a standalone typeahead that contains a predefined list of fruits
## as choices
bsTypeAhead(inputId = "ta1", label = "Choose a fruit", choices = fruits)
## Create the same typeahead in a navbar, with a width of 100px.
bsNavTypeAhead(inputId = "ta2", label = "Fruits", choices = fruits, width = 100)
## In server.R
## Update the second typeAhead to a list of vegetables, update label to reflect change
updateTypeAhead("ta2", choices=veggies, label="Vegetables")
Run the code above in your browser using DataLab