You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiAvatar] Allow advanced emoji usage that requires more than 2 charactersΒ #9043
I wanted to use Avatar component as a decorative stand in for selecting a feature I'm working on. Currently Avatar only accepts 2 characters or baked in EUI icons. Some emojis like π΅οΈββοΈ use more than 2 characters, so they'd be unuseable. This isn't a distinction I think most users would want to mentally parse.
scoping it to EuiAvatar seems like a place to test/start. From what I now understand, we could set a different font stack that prioritizes checking system emoji fonts, first. (amongst a host of other code changes π )
I think its fair to assume we want to avoid adding another font set to the EUI package, but that sounds doable.
Can you create an issue, note the use case, and suggest step 1 be a tech spike?
I don't know if it requires another font stack but i'll leave it to yall and your tech spike.
Use Case
Selecting things visually with user customizable avatars.
Value / Impact
Add a little whimsy to the otherwise text heavy selection pages.
Urgency
As anything, knowing its at least possible sooner than later would be clutch, otherwise I'll design it out.
Do alternatives or workarounds exist?
Not using it or just limiting users to boring two letter usage.
I did a lightning tech spike and we can adjust EuiAvatar to support complex emoji.
In the logic that parses the initials prop (where you can actually provide the emoji to render) we can detect there is an actual complex emoji and that it's only one, to avoid cutting it off ignoring the initialsLength setting.
The tech part: we'd need to use a rather new API, Intl.Segmenter to do the check. In older browsers that don't support it, any complex emoji would still render but in its simpler form, e.g. a "detective" with skin tone and gender would render simply as "detective".
(Again, this would exclusively add support in EuiAvatar, nothing else. More complex things like building a picker and using a custom font are also possible.)
Here's a screenshot of the tests, locally.
@JasonStoltz effort-wise, this would be something small.
I believe the 'API' will be key to the usefulness and discoverability of this... meaning, let's aim for a solution that matches to the convention of... "I type :thumbsup: I get π ". Relying on system fonts, if possible, would likely be preferable so we don't have to package and ship any special font.
So a small change and it seems like a nice UX addition.
Weβve moved this issue to our backlog and marked it as a high priority. We will plan to address it in the near term, but do not yet have a timeline. Weβll keep this issue updated as work progresses.
If you don't hear back from us, please feel free to ping the [@eui-team](https://github.com/orgs/elastic/teams/eui-team) here to ask for an update.
One thing to consider -- this won't cause any issues with server-side validation in Kibana generally or anything right? Like if we add this, can folks start adding emoji's to their Kibana avatars also?
One thing to consider -- this won't cause any issues with server-side validation in Kibana generally or anything right? Like if we add this, can folks start adding emoji's to their Kibana avatars also?
EuiAvatar already supports emoji, but only the simple single-character ones; the enhancement would be supporting also the "complex" ones that require more than 2 characters to render.
// this works now<EuiAvatarname="Not provided"initials="π"/>
I could be wrong but I would think user input is separate from what then goes into an avatar (e.g. the avatar could be displayed using the user's full name, there's no dedicated input for it)
Reacted by Weronika Olejniczak and Jason Stoltzfus
Activity
JasonStoltz commentedon Sep 22, 2025
Related discussion between @julianrosado, @weronikaolejniczak, and @ryankeairns on Sept 19th in #eui.
Generated summary:
acstll commentedon Sep 23, 2025
I did a lightning tech spike and we can adjust EuiAvatar to support complex emoji.
In the logic that parses the
initialsprop (where you can actually provide the emoji to render) we can detect there is an actual complex emoji and that it's only one, to avoid cutting it off ignoring theinitialsLengthsetting.The tech part: we'd need to use a rather new API,
Intl.Segmenterto do the check. In older browsers that don't support it, any complex emoji would still render but in its simpler form, e.g. a "detective" with skin tone and gender would render simply as "detective".(Again, this would exclusively add support in EuiAvatar, nothing else. More complex things like building a picker and using a custom font are also possible.)
Here's a screenshot of the tests, locally.
@JasonStoltz effort-wise, this would be something small.
ryankeairns commentedon Sep 23, 2025
Thanks for the spike!
I believe the 'API' will be key to the usefulness and discoverability of this... meaning, let's aim for a solution that matches to the convention of... "I type
:thumbsup:I get π ". Relying on system fonts, if possible, would likely be preferable so we don't have to package and ship any special font.JasonStoltz commentedon Sep 23, 2025
@acstll Nice! Do you have a quick branch you can add with your spike for future reference?
@ryankeairns I believe that is what arturo is saying -- it's just an internal change, nothing changes on the API.
JasonStoltz commentedon Sep 23, 2025
So a small change and it seems like a nice UX addition.
Weβve moved this issue to our backlog and marked it as a high priority. We will plan to address it in the near term, but do not yet have a timeline. Weβll keep this issue updated as work progresses.
If you don't hear back from us, please feel free to ping the
[@eui-team](https://github.com/orgs/elastic/teams/eui-team)here to ask for an update.JasonStoltz commentedon Sep 25, 2025
One thing to consider -- this won't cause any issues with server-side validation in Kibana generally or anything right? Like if we add this, can folks start adding emoji's to their Kibana avatars also?
acstll commentedon Sep 26, 2025
EuiAvataralready supports emoji, but only the simple single-character ones; the enhancement would be supporting also the "complex" ones that require more than 2 characters to render.I could be wrong but I would think user input is separate from what then goes into an avatar (e.g. the avatar could be displayed using the user's full name, there's no dedicated input for it)