Skip to content

Instantly share code, notes, and snippets.

@jimbrig
Created November 19, 2020 16:48
Show Gist options
  • Select an option

  • Save jimbrig/fc1d21adaf2575798ef6b5b8c5820699 to your computer and use it in GitHub Desktop.

Select an option

Save jimbrig/fc1d21adaf2575798ef6b5b8c5820699 to your computer and use it in GitHub Desktop.
Shiny Clipboard Button
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