Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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")
```