Socket
Book a DemoInstallSign in
Socket

@fw-components/fw-avatar

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fw-components/fw-avatar

Avatar Web Component

latest
npmnpm
Version
2.3.2
Version published
Maintainers
2
Created
Source

fw-avatar-group

FW Avatar Group component is used to show a list of items as avatars. It also displays a detailed list on clicking any avatar.

Installation

npm i @fw-components/fw-avatar

Example usage

let users = [{name: "Richard", company: "PiedPiper"},{name: "Dinesh", company: "PiedPiper"},{name: "Jared", company: "PiedPiper"}]
<fw-avatar-group .items=${users} nameAttribute="name" secondaryAttribute="company"></fw-avatar-group>

API

Properties/Attributes

NameTypeDefaultDescription
itemsArray[]data as Array of objects
nameAttributeString"userName"key in item used to display initials on avatar and title on list
secondaryAttributeStringnullkey in item used to display secondary line for the item in the list
maxCountNumber5max count of avatars to be displayed in the group
headerString"Members"header of the list
avatarBackgroundStringcustom hsl for item[nameAttribute]background for the avatar
primaryAction*Objectnullaction to be displayed on top of list
showSearchBarBooleanfalseshow search bar for the items
emptyStateMessageStringnullmessage to be displayed when state is empty while searching
emptyStateAction**Objectnullaction to be displayed when state is empty while searching
secondaryAction**Objectnullaction to be displayed at bottom of list
absoluteBooleanfalseif true, list is positioned absolute on devices with width < 767px

*primaryAction => {title : 'Title for the action button', icon : 'mwc-icon to show next to button, default to add_circle'}

**empty state/secondary action => {title : 'Title for the action button', closeDialog : 'boolean to close the dialog on click'}

Methods

None

Events

Event NameDetailDescription
item-clicked{ item }Fired when an item is clicked from the list, includes the item as detail
primary-action-clickednullFired when primary action is clicked
secondary-action-clickednullFired when secondary action is clicked
empty-state-action-clicked{ value : "search bar value" }Fired when empty state action is clicked, includes value in the search bar as detail

CSS Custom Properties

fw-avatar-group uses fw-avatar internally

Global Custom Properties

NameDescription
dark-colorcolor of text on avatar
light-colorborder of overlapping avatar

fw-avatar

FW Avatar component is used to show an avatar

Installation

npm i @fw-components/fw-avatar

Example usage

<fw-avatar type="initials" name="Richard Hendricks"></fw-avatar>

API

Properties/Attributes

NameTypeDefaultDescription
nameStringnullname used for initials
titleStringnametitle visible on hover, defaults to name
typeStringnonetype of avatar initials/image
colorStringcustom hsl for name or 'plum'color of avatar
imgSrcStringnullsrc of image when type of avatar is image

Methods

None

Events

None

CSS Custom Properties

NameDefaultDescription
avatar-colorwhitetext color on avatar
avatar-size30pxsize of avatar
bordernoneborder of avatar

Global Custom Properties

NameDescription
font-familyfont-family for text on avatar

FAQs

Package last updated on 01 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts