Manual Usage
If you prefer to manually integrate the core package @avatar-generator/core
into your project, you can use the following approach. This guide will walk you through creating an avatar using the core package directly.
Usage Example
Here is an example of how to manually generate an avatar using the core package:
HTML to display the avatar
Summary
In this guide, you learned how to manually integrate the @avatar-generator/core
package to create customizable avatars in your project. The steps include:
- Importing the
createAvatar
function from@avatar-generator/core
. - Defining options for the avatar, such as
name
,backgroundColor
,textColor
,fontSize
, andshape
. - Adding the generated avatar to the DOM.
By following this approach, you can manually create avatars without using pre-built components, giving you full control over the avatar’s appearance and usage in your project.
This guide demonstrates how to manually create and add an avatar to your page using the @avatar-generator/core
package.