Description Usage Arguments Value Author(s) Examples
Update text to be copied in clipboard on the client
1 2 3 4 5 6 7 8 | CopyButtonUpdate(
session,
id = "copybtn",
label = "Copy to Clipboard",
icon = NULL,
text = "Sample Text",
modal = FALSE
)
|
session |
Session object passed to function given to shinyServer |
id |
HTML ID to use for button. |
label |
Text label of the button. |
icon |
icon to be shown on the button before label. |
text |
Text to be copied in clipboard. |
modal |
Whether button is used within bootstrap modal. |
Button
Deepanshu Bhalla
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | if (interactive()) {
ui <- fluidPage(
# Setup
use_copy(),
# Text Input 1
textInput("text", "Enter Your Text"),
# Copy Button 1
CopyButton(
"copybtn",
"Copy to Clipboard",
icon = icon("copy"),
text = "No Text Found",
class = "btn-primary",
width = "150px"
)
)
server <- function(input, output, session) {
observe({
req(input$copybtn)
CopyButtonUpdate(session,
id = "copybtn",
label = "Copy to Clipboard",
icon = icon("copy"),
text = input$text
)
})
}
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.