3rd-Party Plugins

Clipboard

Native KtUI KTClipboard provides a modern approach to copy and cut values to the clipboard.

Metronic integrates the KTUI Clipboard component to deliver a flexible and user-friendly interface for Clipboard. For detailed guidance on implementation and customization, refer to the KTUI Clipboard documentation.

Installation

Clipboard behavior is provided by KtUI’s native KTClipboard component (shipped with Metronic via KtUI).

Require Assets

To use native clipboard behavior, include KtUI assets (as shown below). Clipboard.js is not required .
				
					<!DOCTYPE html>
<html>
 <head>
  <!--Core styles-->
  <link href="/dist/assets/css/styles.css" rel="stylesheet"/>
 </head>
 <body>
  <h1>
   Hello world!
  </h1>
  <!--Core bundle script-->
  <script src="/dist/assets/js/core.bundle.js">
  </script>
  <!--KtUI vendor script -->
  <script src="/dist/assets/vendors/ktui/ktui.min.js">
  </script>
  <!--Custom script -->
  <script src="/dist/assets/pages/plugins/clipboard/default.js">
  </script>
 </body>
</html>

				
			

Copy Value

Click the copy button to copy the input value below.

Cut Value

Apply data-kt-clipboard-action="cut" attribute to cut the input value below.

Predefined Value

Add the data-kt-clipboard-text attribute to the action button below and it will copy the value set on click.

Copy Text

Add the attribute data-kt-clipboard-target to an action button with the static element's id to get it working.
This is a sample static text string to copy!