Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom SVG icons as iX icon #1278

Open
2 tasks done
ugurbayraktarr opened this issue May 15, 2024 · 3 comments
Open
2 tasks done

Use custom SVG icons as iX icon #1278

ugurbayraktarr opened this issue May 15, 2024 · 3 comments
Labels
type: enhancement New feature or request Workflow: In progress Issue will be part of the next release

Comments

@ugurbayraktarr
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

Suggestion / feature request

As far as I know, we have 2 options in order to add an icon to our project.
1- Use default ix icons with name.
2- Use custom icons with url.

We want to use our custom svg icons in our project. So, we hosted them on our application and used them as relative url.
But there is a problem. When we need to use the same icon many times (some list screens require this), the IxIcon component makes an api call, fetches the svg file and renders it.
If the screen has many icons, the svg files are loaded in order, so we can see the empty area as they load. (In the example, we couldn't observe this because stackblitz uses disk cache).

I've prepared an example to see multiple fetches (see network): https://stackblitz.com/edit/ygj7zm-jp8chf?file=src%2FApp.tsx

I suggest that, if we can pass svg as an element to the IxIcon component, we can handle this problem.
2nd suggestion, can iX handle this case via "IxApplicationContext" or something else that allows just make only one api call?

Please note that the solution should cover all components related with icon, i.e.: IxIconButton component's icon property.

@ugurbayraktarr ugurbayraktarr added triage We discuss this topic in our internal weekly type: enhancement New feature or request labels May 15, 2024
@danielleroux
Copy link
Collaborator

danielleroux commented May 15, 2024

You can test the latest snapshot build: npm i @siemens/[email protected] (no production version will be deleted) or the stackblitz https://stackblitz.com/edit/ygj7zm-flt3qm?file=package.json

The ix-icon is part of another repo, and here is the PR which should solve the loading issue siemens/ix-icons#56

@ugurbayraktarr
Copy link
Author

It seems that this version solves the problem perfectly.
When do you plan to release this version?

@danielleroux
Copy link
Collaborator

Can not call you a exact date, but as soon as the PR is merged we check if we have some other work to do afterwards we will build the release version.

@matthiashader matthiashader added Workflow: In progress Issue will be part of the next release and removed triage We discuss this topic in our internal weekly labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request Workflow: In progress Issue will be part of the next release
Projects
None yet
Development

No branches or pull requests

3 participants