KinoClipboard (kino_clipboard v0.1.1)
A component that allows you to copy text to the clipboard.
Summary
Functions
Callback implementation for Kino.JS.Live.handle_connect/1.
Callback implementation for Kino.JS.Live.handle_event/3.
Callback implementation for Kino.JS.Live.init/2.
Creates a "Copy to clipboard" button.
Functions
Callback implementation for Kino.JS.Live.handle_connect/1.
Callback implementation for Kino.JS.Live.handle_event/3.
Callback implementation for Kino.JS.Live.init/2.
@spec new( String.t() | (-> String.t()), keyword() ) :: Kino.JS.Live.t()
Creates a "Copy to clipboard" button.
Data to be copied can be provided as a string or as a function that returns a string.
Options
:label- The label of the button. Defaults to "Copy to clipboard".
Examples
KinoClipboard.new("Hello world!")
KinoClipboard.new(fn -> "Hello world!" end)
KinoClipboard.new(fn -> "Hello world!" end, label: "Copy to clipboard")