Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JohnCoene/nter
⌨️ Trigger shiny buttons with the enter key
https://github.com/JohnCoene/nter
r rstats shiny
Last synced: 9 days ago
JSON representation
⌨️ Trigger shiny buttons with the enter key
- Host: GitHub
- URL: https://github.com/JohnCoene/nter
- Owner: JohnCoene
- License: other
- Created: 2019-12-05T21:21:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-27T09:30:50.000Z (almost 5 years ago)
- Last Synced: 2024-11-25T11:10:02.216Z (18 days ago)
- Topics: r, rstats, shiny
- Language: R
- Homepage:
- Size: 4.88 KB
- Stars: 22
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - JohnCoene/nter - ⌨️ Trigger shiny buttons with the enter key (R)
README
# nter
Trigger shiny action button with the return key.
## Example
Use `nter` in your Shiny UI in to which you pass the id of the button to be triggered.
``` r
library(nter)
library(shiny)ui <- fluidPage(
textInput("text", ""),
actionButton("send", "Don't click hit enter"),
verbatimTextOutput("typed"),
nter("send", "text") # trigger 'send' button when 'text' is active.
)server <- function(input, output) {
txt <- eventReactive(input$send, {
input$text
})output$typed <- renderPrint(txt())
}shinyApp(ui, server)
```
### Get It
``` r
install.packages("remotes")
remotes::install_github("JohnCoene/nter")
```