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: 25 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-27T09:30:50.000Z (almost 5 years ago)
- Last Synced: 2024-08-13T07:15:23.284Z (3 months 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
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")
```