Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom attribute / Directive in Stencil.js

Can anyone guide me about this? Can Stencil.js add Custom attribute / Directive like Aurelia/Angular to existing elements or not?

I don't find any doc about this on their site. Only creating a new component nothing about extending existing elements.

I want to add a custom attribute to div or any HTML element Is it possible in Stencil.js?

like image 544
HamedFathi Avatar asked Mar 06 '26 19:03

HamedFathi


1 Answers

Attribute-based components aren't possible with Stencil. The library implements the Custom Elements spec, which only works with tags.

Extending existing elements isn't supported either. The spec allows extensions of builtins, but it isn't implemented in Stencil and browser support is limited.

like image 112
matthewsteele Avatar answered Mar 08 '26 07:03

matthewsteele



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!