Create Avatar from name initials
npm install react-initial-avatarCreate sleek avatars with initials using the lightweight 'react-initial-avatar' component for your React applications
``bash`
npm install react-initial-avatarUsage
`jsx
import React from "react";
import Avatar from "react-initial-avatar";
const App = () => {
return (
export default App;
`
| Prop | Type | Default | Description |
|------------------|--------|------------|--------------------------------------------------------|
| name | string | | The name to extract initials from. |
| height | number | 30px | The height of the initials container. |30px
| width | number | | The width of the initials container. |#f0f8ff
| backgroundColor | string | | The background color of the initials container. |#6495ed
| color | string | | The text color (initials color) inside the container. |none
| borderRadius | number | | The border radius of the initials container. |none
| borderWidth | number | | The border width of the initials container. |none
| borderColor | string | | The border color of the initials container. |{}
| style | object | | (optional) custom style object. |" "
| splitWith | string | | delimeter to split name with |
jsx
import React from "react";
import Avatar from "react-initial-avatar";const Example = () => {
return (
);
};
export default Example;
``MIT © afzalali27