Skip to content

zk-copy-button ​

A button that copies a text.

Props ​

PropTypeDefaultDescription
textstring|nullnullText to copy
targetstring|nullnullSelector of the element whose text is copied (#command), over text
labelstring'Copy'Text of the button, when there is no slot
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

Slots ​

SlotDescription
defaultReplaces the label

Needs zk-scripts. While copied, the button has data-copied: style it.

Examples ​

Command ​

blade
<code id="cmd">composer require zairakai/laravel-blade-components</code>
<x-zk-copy-button target="#cmd" />

<x-zk-scripts />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.