Comments (4)
@metonym
I guess that is fine then; turning SVGs into components is not that difficult and does not necessarily need to be handled by the library.
By the way, there are still some direct references to carbon-icons-svelte
in prop documentation, e.g. for Button
:
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;
from carbon-icons-svelte.
Why not cast a custom icon to a CarbonIcon
type?
from carbon-icons-svelte.
The issue is that there is no actual "casting" here, you can only make type assertions, which do not change the runtime type. CarbonIcon
provides a specific interface via props and events which are used by the Carbon components, however, the user of the icons library never really interacts with this API directly, so it would be useful if the icon library could provide a way of creating components with the correct interface, so the API can change independently without issues.
If e.g. an icons would at some point expose a new event which is required by some Carbon component to work correctly and my icon component code is out of date, things would stop working. So for the user of these libraries it would be convenient to have something like my icon
function implemented in the library, that takes an SVG/size as input and returns a valid icon that has the exact same functionality as all the standard icons.
from carbon-icons-svelte.
@brunnerh Resolved by carbon-design-system/carbon-components-svelte#853?
from carbon-icons-svelte.
Related Issues (20)
- Preview website is not working anymore HOT 1
- Package format issue? HOT 2
- TypeScript support for deeply imported Svelte components
- Package crashes npm, yarn, & node several times HOT 3
- Very Much Error in run HOT 2
- Passing v11 icons to components as prop with specific size HOT 6
- It seems the Delete icon has been... deleted ? HOT 2
- Mention breaking changes of upstream library in release notes? HOT 7
- import many icons with single import HOT 4
- Error when using icons HOT 1
- messaging apps icon HOT 1
- Use named imports in docs HOT 3
- Package optimizations
- Update contributing guide with release flow HOT 1
- Fix generated `build-info.json` with correct icons and classification
- Viewbox
- Svelte 4 support
- Improve security practices for `carbon-icons-svelte` HOT 1
- Update the Twitter SVG to X SVG HOT 1
- vite-plugin-svelte: missing exports condition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbon-icons-svelte.