Back

CopyButton

Basic

Beside a code snippet

npm install @mljr/ui

Multiple targets

git clone https://github.com/MrCodeEU/ui.git
cd ui && go build ./...

Custom Icons

Pass Icon and CopiedIcon to replace the default SVG icons.

curl -sL https://example.com/install.sh | bash

Usage

@feedback.CopyButton(feedback.CopyButtonProps{
    Text:        "text to copy",
    Label:       "Copy",         // default: "Copy"
    CopiedLabel: "Copied!",      // default: "Copied!"
    Icon:        myIcon(),       // custom icon templ.Component (optional)
    CopiedIcon:  myCheckIcon(),  // custom copied-state icon (optional)
})