Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Clipboard

Clipboard components are tools designed to facilitate the copying and pasting of data within an application. They ensure seamless data transfer and storage, enhancing user efficiency and interaction.

Requires Additional Installation

Note that this component requires the use of the third-party Clipboard plugin.

Installation

  1. Install Clipboard

    Install clipboard via npm

    Terminal
                              
                                npm i clipboard
                              
                            
  2. Add the Clipboard JavaScript

    Include the JavaScript <script> near the end of your </body> tag:

    HTML
                              
                            
  3. Add the Preline Helper JavaScript

    Include the JavaScript <script> after the helper-clipboard.js file.

    HTML
                              
                            

Copy text

Copy static text directly from a button or trigger element.

Copy input value

Copy the current value of an input field to the clipboard.

Clipboard with tooltip

Show clipboard feedback in a tooltip after the copy action succeeds.

Customize the tooltip message shown after copying.

Use clipboard actions inside a modal without changing the interaction pattern.

© 2026 Preline Labs.