Ship faster with goilerplate templUI Pro

Copy Button

Button component that copies content from target elements to clipboard.

Source Tailwind CSS JavaScript

Hello, World!

Installation

  1. Install the component

    templui add copybutton
  2. Add the JavaScript to your layout

    @copybutton.Script()
    

    Call this template in your base layout file (e.g., in the <head> section).

Examples

With Input

With Code Block

fmt.Println("Hello, World!")

API Reference

Required parameter
Hover for description

CopyButton

Button component that copies content from a target element to the clipboard.

Name Type Default
ID
string
-
Class
string
-
Attrs
templ.Attributes
-
TargetID
string
-