@finastra/avatar
TypeScript icon, indicating that this package has built-in type declarations

1.8.1 • Public • Published

Avatar

See it on NPM! How big is this package in your project? Storybook

This component is an IT representation of a user. It can be used to figures users or to enable an access to a user profile menu.

Usage

Import

npm i @finastra/avatar
import '@finastra/avatar';
...
<fds-avatar large name="Adnen Manai"></fds-avatar>

API

Properties

Property Attribute Type Default Description
dense dense boolean false Make the avatar smaller
large large boolean false Make the avatar bigger
name name string "" Name of the avatar, used to generate the initials (Displayed on hover)
primary primary boolean false Use theme's primary color as background
secondary secondary boolean false Use theme's secondary color as background
shortName shortName string "" Use this property to override the initials

Methods

Method Type
transformName (fullName: string, dense?: boolean | undefined): string
transformShortName (shortName: string, dense?: boolean | undefined): string

CSS Custom Properties

Property Type Default Description
--fds-avatar-font-size "16px" Font size of the avatar
--fds-avatar-size "48px" Size of the avatar
--fds-primary color "#694ED6" Color of the start of the gradient
--fds-secondary color "#C137A2" Color of the end of the gradient

Package Sidebar

Install

npm i @finastra/avatar

Weekly Downloads

9

Version

1.8.1

License

MIT

Unpacked Size

32.2 kB

Total Files

17

Last publish

Collaborators

  • david.bocle
  • ffdcbot
  • ttalbot