Select to view content in your preferred language

Avatar as icon for Action

833
2
01-11-2024 11:33 AM
BjornKuiper
Emerging Contributor

Is there a way to set the icon property of an Calcite Action to be an Calcite Avatar?

If not, how do you center/position it similar as the Calcite Actions and make the Calcite Avatar clickable in a CalciteActionBar / CalciteActionGroup?

This is what i have now, but the Calcite Avatar is not behaving similar as an Calcite Action and not aligned correctly:

BjornKuiper_0-1705001557169.png

Thanks!

2 Replies
KittyHurley
Esri Contributor

@BjornKuiper At this time this is not a supported feature.

There are some potential approaches to consider as part of the workflow, such as:

  1. Using the "user" icon in an Action's "action-end" slot, also containing a tooltip with Avatar: https://codepen.io/geospatialem/pen/wvOpbrr 
  2.  Using CSS styling to adjust the "actions-end" slot containing the Avatar when the Action Bar is collapsed/expanded: https://codepen.io/geospatialem/pen/dyrdBwV 
  3. Consider using the Navigation "user" slot with Navigation User for Avatar: https://codepen.io/geospatialem/pen/KKEQOMd 
0 Kudos
BjornKuiper
Emerging Contributor

Thank you for your time responding. I moved forward with a CalciteAction:

<CalciteAction data-action-id="user" text="User" compact alignment='center'>

<span>
  <CalciteAvatar slot='image' fullName='Lorem Ipsum' scale='m'></CalciteAvatar>
</span>
</CalciteAction>
0 Kudos