Guidance or docs on how to use existing web components libraries? #59
-
If I want to use Google Charts web components, how do I integrate it with Fable? Do I just use importDynamic and also create the bindings for it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You just need to register them and then you can use them normally in the templates. It depends if the library requires you to call a Jordan Marr does use But if you want to import things statically, |
Beta Was this translation helpful? Give feedback.
You just need to register them and then you can use them normally in the templates. It depends if the library requires you to call a
register
function explicitly or not. For example, Fluent UI requires it but Shoelace does not.Jordan Marr does use
importDynamic
here: https://github.com/JordanMarr/fable-lit-fullstack-template/blob/ebb39776725190bea6915d82b30d62889bd7ac6b/Template/WebLit/src/Registrations.fsBut if you want to import things statically,
importSideEffects
should work too (this also allows you to include the components in your bundle). This example is for Solid, but it should work the same in Lit: