Svelte

HTMLPLUS elements are fully compatible with Svelte framework.

Install

Install HTMLPLUS package into Svelte application.

npm install @htmlplus/ui

Usage

Import the reference of elements.

<script> import '@htmlplus/ui'; </script> <plus-switch />

All HTMLPLUS elements are available as same as a local tag (div, video, etc.) in the svelte project.

Properties

To set properties and attributes.

<script> import '@htmlplus/ui'; </script> <plus-switch disabled/>

Events

To handle event's callback.

<script> import '@htmlplus/ui'; function onChange() { alert('The switch toggled!') } </script> <plus-switch on:plus-change={onChange} />