withCopy | R Documentation |
Enable a predefined button or link to interact with the clipboard.
withCopy(x, target_id = NULL, text = NULL, cut = FALSE)
x |
|
target_id |
The id of the UI output to copy. |
text |
Value to copy to the clipboard when the button is clicked. |
cut |
Cut text to clipboard. |
Updated button or link.
if (interactive()) { ui <- fluidPage( textOutput("test_text"), # Copy other output withCopy(actionLink("copyb1", "Copy", icon = icon("clipboard")), target_id = "test_text"), withCopy(actionButton("copyb2", "Copy", icon = icon("clipboard")), text = "copy copy me"), ) server <- function(input, output, session) { output$test_text <- renderText("The text we are to copy!") } shinyApp(ui, server) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.