Add-ons

About Add-ons

Since version 6.10, you can use add-on components in only 1 way.

  1. Use the individual modules in the Add-ons folder. Import the selected modules you want to use and combine the results. Finally, pass it to the function when you call it. See the example below.

const htmlWidget = importModule("html-widget")
const symbol = importModule("html-widget-symbol")
const hr = importModule("html-widget-hr")
let addons = {symbol, hr}

await htmlWidget(`
<widget>
  <hr/>
  <symbol>bolt</symbol>
</widget>
`, false, addons)

When using method 2, it is important to declare the variable of the module importation as the real names of the tags. If a name other than the real tag name is used, the name of the tag that you using while creating the widget will change. For example, if you declared the <hr> addon as whatever than you would enter <whatever> to use the hr.

const whatever = importModule("html-widget-hr")
<widget>
  <whatever>
</widget>

Last updated