is-velte
0.0.1
Github

is-velte

Create any html tag in Svelte using it's name as string

yarn add is-velte & <Is tag="h1">Hello Svelte</Is>

Motivations:

Basically, I created that component to have a bit more of flexibility when creating specific Svelte components that handle multiple html tags.

So, the only way I manage to do this is to actually change by hand some parts of a Svelte generated component code, both the Client and Server version.

Because that, the peer dependency will be strict tied to a Svelte release version, updating every time we had a new Svelte release.

How to Use:

yarn add is-velte

Then:

import Is from 'is-velte';

And:

<Is tag='section'>
  My Section
</Is>

The "tag" property is a "div" by default!

Know Limitations:

  • Current, we don't have a way to pass down events, like on:*. So I will add the most common events to the Is component.
  • ...