nextjs-animal-avatar-generator
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

NextJS Animal Avatar Generator

This is a fork of the Animal Avatar Generator library, modified to work with Next.js

Modifications for Next.js Compatibility

To make this library compatible with Next.js, the following changes were made:

  1. Updated the TypeScript configuration to output CommonJS modules instead of ESM.
  2. Provided instructions for users on how to adjust the import syntax for the avatar function in their Next.js components to work with this modified library.

Usage in Next.js

In your Next.js project, install the package using npm or yarn:

npm install https://github.com/vlazic/nextjs-animal-avatar-generator --save yarn add https://github.com/vlazic/nextjs-animal-avatar-generator

To use the generator in your Next.js components, you can require the library:

const avatar = require('nextjs-animal-avatar-generator').default;

Then, you can use the avatar function to generate SVG avatars:

function Avatar(props) {
  const svg = avatar(props.name, { size: 200 });

  return (
    <div width="200" height="200" dangerouslySetInnerHTML={{ __html: svg }} />
  );
}

For the complete list of configuration options, please refer to the original Animal Avatar Generator library.

License

MIT

Package Sidebar

Install

npm i nextjs-animal-avatar-generator

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

38.9 kB

Total Files

33

Last publish

Collaborators

  • vlazic