rclipButton | R Documentation |
Creates an action button or link that will send user-defined text to the OS clipboard.
rclipButton(inputId, label, clipText, modal = FALSE, tooltip, placement, options, ...)
rclipLink(inputId, label, clipText, modal = FALSE, ...)
inputId |
The |
label |
The contents of the button or linkâusually a text label, but you could also use any other HTML, like an image. |
clipText |
A single scalar character variable to be sent to the clipboard. |
modal |
A logical flag indicating whether the button will be shown in a modal window (TRUE) or not (NOT). |
tooltip |
A strip to display in a tooltip (using the |
placement |
The placement of the tooltip relative to the button |
options |
List of options for the tooltip |
... |
Additional arguments (e.g. |
Sebastien Bihorel
https://clipboardjs.com/
rclipboardSetup
, tooltip
## Not run
## Not run:
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(
inputId = "clipbtn",
label = "rclipButton Copy",
clipText = input$copytext,
icon = icon("clipboard"),
tooltip = "Click me to copy the content of the text field to the clipboard!",
options = list(delay = list(show = 800, hide = 100), trigger = "hover")
)
})
}
shinyApp(ui = ui, server = server)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.