Clipboard

Modern copy to clipboard. No Flash. Just 3kb gzipped

Clipboard.js

Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load.
But most of all, it shouldn't depend on Flash or any bloated framework. That's why clipboard.js exists.

Copy text from another element

A pretty common use case is to copy content from another element. You can do that by adding a data-clipboard-target attribute in your trigger element.

Cut text from another element

Additionally, you can define a data-clipboard-action attribute to specify if you want to either copy or cut content.

If you omit this attribute, copy will be used by default.
As you may expect, the cut action only works on <input> or <textarea> elements.

Copy text from attribute

Truth is, you don't even need another element to copy its content from. You can just include a data-clipboard-text attribute in your trigger element.

Copy text from another element

There are cases where you'd like to show some user feedback or capture what has been selected after a copy/cut operation.

That's why we fire custom events such as success and error for you to listen and implement your custom logic.

let clipboard = new Clipboard( ".btn" );

clipboard.on( "success", => (e) {
   console.info( "Action : ", e.action );
   console.info( "Text : ", e.text );
   console.info( "Trigger : ", e.trigger );

   e.clearSelection();
});

clipboard.on( "error", => (e) {
   console.error( "Action : ", e.action );
   console.error( "Trigger : ", e.trigger );
});
Paste your copied text.
Nifty

Background Images

Add an image to replace the solid background color

Layouts

Layouts
Transitions
Header
Additional Offcanvas

Select the offcanvas placement.

Sidebars

Navigation
Sidebar

Colors

Modes
Color Schemes
Expanded Header
Fair Header
Full Header
Primary Nav
Brand
Tall Header
Miscellaneous
Scrollbars

Hides native scrollbars and creates custom styleable overlay scrollbars.

Offcanvas Header
Content Here

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente eos nihil earum aliquam quod in dolor, aspernatur obcaecati et at. Dicta, ipsum aut, fugit nam dolore porro non est totam sapiente animi recusandae obcaecati dolorum, rem ullam cumque. Illum quidem reiciendis autem neque excepturi odit est accusantium, facilis provident molestias, dicta obcaecati itaque ducimus fuga iure in distinctio voluptate nesciunt dignissimos rem error a. Expedita officiis nam dolore dolores ea. Soluta repellendus delectus culpa quo. Ea tenetur impedit error quod exercitationem ut ad provident quisquam omnis! Nostrum quasi ex delectus vero, facilis aut recusandae deleniti beatae. Qui velit commodi inventore.