1.0.7 โ€ข Published 5 months ago

next-clippy v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Next Clippy ๐Ÿ“‹

Next Clippy Logo

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. ๐Ÿ“

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago