UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 480 B
import{jsxs as o,jsx as e}from"react/jsx-runtime";import t from"clsx";import p from"../hooks/useClipboardCopy.js";const s="NexusCodeCopyButton";function c(c){const{code:r,...a}=c,{copy:i,isCopied:n}=p();return o("button",{...a,"aria-label":"Copy the code",type:"button",className:t(`${s}-root`,"code-copy"),onClick:async o=>{o.stopPropagation(),await i(r)},children:[n?"Copied":"Copy"," ",e("span",{className:t(`${s}-copyKeypress`,"code-copyKeypress")})]})}export{c as default};