Created
November 19, 2020 16:48
-
-
Save jimbrig/fc1d21adaf2575798ef6b5b8c5820699 to your computer and use it in GitHub Desktop.
Shiny Clipboard Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rclipboard) | |
| library(shiny) | |
| # The UI | |
| ui <- bootstrapPage( | |
| rclipboardSetup(), | |
| # Add a text input | |
| textInput("copytext", "Copy this:", "Zlika!"), | |
| # UI ouputs for the copy-to-clipboard buttons | |
| uiOutput("clip"), | |
| # A text input for testing the clipboard content. | |
| textInput("paste", "Paste here:") | |
| ) | |
| # The server | |
| server <- function(input, output) { | |
| # Add clipboard buttons | |
| output$clip <- renderUI({ | |
| rclipButton("clipbtn", "rclipButton Copy", input$copytext, icon("clipboard")) | |
| }) | |
| } | |
| shinyApp(ui = ui, server = server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment