1.1.0 • Published 2 months ago

react-initial-avatar v1.1.0

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

React Initials Avatar

Create sleek avatars with initials using the lightweight 'react-initial-avatar' component for your React applications

Installation

npm install react-initial-avatar

Usage

import React from "react";
import Avatar from "react-initial-avatar";

const App = () => {
  return (
    <div>
      <Avatar name="John Doe" />
    </div>
  );
};

export default App;

Props

PropTypeDefaultDescription
namestringThe name to extract initials from.
heightnumber30pxThe height of the initials container.
widthnumber30pxThe width of the initials container.
backgroundColorstring#f0f8ffThe background color of the initials container.
colorstring#6495edThe text color (initials color) inside the container.
borderRadiusnumbernoneThe border radius of the initials container.
borderWidthnumbernoneThe border width of the initials container.
borderColorstringnoneThe border color of the initials container.
styleobject{}(optional) custom style object.
splitWithstring" "delimeter to split name with

Examples

import React from "react";
import Avatar from "react-initial-avatar";

const Example = () => {
  return (
    <div>
      <Avatar name="Afzal Ali" />
      <Avatar color="red" backgroundColor="#FFF" name="Elizabeth Smith Brown" />
      <Avatar borderRadius={50} borderWidth={1} borderColor="black" name="Jane Smith" />
    </div>
  );
};
export default Example;

License

MIT © afzalali27

1.1.0

2 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago