- Notifications
You must be signed in to change notification settings - Fork11
clipboard.js for R/Shiny Applications
License
sbihorel/rclipboard
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
clipboard.js is a super light javascript framework,which provides copy-to-clipboard functionality using HTML5. The simplerclipboardR package is simple and leveragesclipboard.js functionality to provide areactive copy-to-clipboard UI button component, calledrclipButton, and areactive copy-to-clipboard UI link component, calledrclipLink, forShiny R applications.
WhilerclipButton andrclipLink will work in applications that use nativeshiny UI constructors, the code below illustrates a marginally more complexexample in which a tooltip is displayed when hovering on top of the button thanksto the use of UI constructors from thebslib package.
library(shiny)library(bslib)library(rclipboard)# The UIui<-bslib::page_fluid( 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 serverserver<-function(input,output) {# Add clipboard buttonsoutput$clip<- renderUI({ rclipButton(inputId="clipbtn",label="rclipButton Copy",clipText=input$copytext,icon= icon("clipboard"),tooltip="Click me... I dare you!",placement="top",options=list(delay=list(show=800,hide=100),trigger="hover") ) }) }shinyApp(ui=ui,server=server)
About
clipboard.js for R/Shiny Applications
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.