Enable a predefined button or link to interact with the clipboard.
Arguments
- x
actionButton
oractionLink
.- 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.
Examples
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)
}