JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q39652F
  • License MIT

A next.js-friendly clipboard utility with support for text, JSON, HTML, and images.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (next-clippy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Next Clippy ๐Ÿ“‹

    Next Clippy is a lightweight React hook that enables seamless text copying functionality in Next.js applications.

    
    
    

    โœจ Features

    • ๐Ÿ“‹ Copy text to the clipboard effortlessly.

    • ๐Ÿ”„ Provides a copied state to track the copying status.

    • โšก Optimized for Next.js and modern React development.

    ๐Ÿ“ฆ Installation

    Use npm or yarn to install:

    npm  install  next-clippy
    

    or

    yarn  add  next-clippy
    
    
    
    

    ๐Ÿ›  Usage

    Import and use the useClipboard hook in your component:

    import { useClipboard } from "next-clippy";
    
    export default function CopyComponent() {
        const { copy, copied } = useClipboard();
    
        return (
            <div>
                <button onClick={() => copy("Hello, World!")}>Copy Text</button>
                {copied && <span>Copied! โœ…</span>}
            </div>
        );
    }
    
    
    

    ๐Ÿ“œ API

    useClipboard()

    Returns an object containing:

    • ๐Ÿ“Œ copy(text: string): Copies the provided text to the clipboard.

    • โœ… copied: boolean: Indicates whether the text was recently copied.

    ๐Ÿงช Running Tests

    Ensure jest and @testing-library/react-hooks are installed. Then run:

    npm  test
    
    
    
    

    ๐Ÿค Contributing

    Contributions are welcome! ๐ŸŽ‰ Feel free to fork the repository and submit a pull request.

    
    
    

    ๐Ÿ“„ License

    This project is licensed under the MIT License. ๐Ÿ“