3

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?

HamedFathi
  • 3,667
  • 5
  • 32
  • 72

1 Answers1

5

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.

matthewsteele
  • 1,797
  • 1
  • 15
  • 31