[Question]: How to register custom icons for sbb-icon
Preflight Checklist
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
It affects the following packages
Components
Your Question
How to register custom icons?
Give us a summary about your question
in https://lyne-storybook.app.sbb.ch/?path=/docs/elements-sbb-icon--docs it is hinted, that custom icons from another namespace could be used, but it is not clear how.
Provide as much useful information as you can
No response
It's already possible, but we need to improve API and documentation (#3606)
Hi @jeripeierSBB, how is it already possible to register and use a custom icon?
We want to use a custom icon for the sbb-status component. If it's already possible or it's planned for the near future, I would not need to implement a workaround.
Yes, it is already possible. You can register your own icon namespace.
import { mergeConfig } from '@sbb-esta/lyne-elements/core/config.js';
mergeConfig({
icon: {
namespaces: new Map<string, string>()
.set('your-namespace', 'https://domain-of-your-icons/')
}
});