Skip to content

[EuiAvatar] Allow advanced emoji usage that requires more than 2 charactersΒ #9043

Description

@julianrosado

Problem Statement

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.

Proposed Solution

From @ryankeairns

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.

Related code or customizations

Additional context (Optional)

Designs or Specs (Optional)

Activity

  1. added
    request
    on Sep 22, 2025
  2. JasonStoltz commented on Sep 22, 2025

    @JasonStoltz
    Contributor

    Related discussion between @julianrosado, @weronikaolejniczak, and @ryankeairns on Sept 19th in #eui.

    Generated summary:

    • Julian suggested enabling support for emojis that use more than 2 characters, like πŸ•΅οΈβ€β™€οΈ, to provide a more lively indicator.
    • Ryan proposed scoping the changes to the EuiAvatar component and exploring a solution that prioritizes checking system emoji fonts.
    • Julian created a feature request with the use case and suggested a tech spike as the first step.
    • Weronika indicated they would review any progress made by Ryan
    • Weronika encourage Ryan to open a draft PR if they had any work in progress
  3. acstll commented on Sep 23, 2025

    @acstll
    Contributor

    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.

    Image
  4. ryankeairns commented on Sep 23, 2025

    @ryankeairns
    Contributor

    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.

  5. JasonStoltz commented on Sep 23, 2025

    @JasonStoltz
    Contributor

    @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.

  6. JasonStoltz commented on Sep 23, 2025

    @JasonStoltz
    Contributor

    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.

  7. JasonStoltz commented on Sep 25, 2025

    @JasonStoltz
    Contributor

    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?

  8. acstll commented on Sep 26, 2025

    @acstll
    Contributor

    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
    <EuiAvatar name="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)

  9. self-assigned this
    on Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions