Extending Norska
It's better to climb together
Norska can be extended and customized to multiply creative possibilities.
Using an add-on
Adding an add-on to Norska is extremely simple: just pass it as a parameter before initialization.
New directives will be accessible via the prefix defined in the add-on configuration file (generally the name of the add-on itself) and magic properties will be accessible directly.
Creating an add-on
An add-on consists of various files for directives and magic properties, plus a file used to index all imports and configure parameters.
Name | Description |
---|---|
namespace | The namespace between Norska's prefix and the name of your directives |
directives | An object containing all the directives of your add-on |
magics | An object containing all the magic properties of your add-on |
Let's take a closer look at the code in our example, how does it works ?
myAddon.ts
something.ts
stuff.ts
Norska doesn't alter Alpine's API, so don't hesitate to read the documentation to find out how to create custom directives and magic properties.
This method isn't the only way to add functionality to Alpine or Norska, it's just something I've added to create a simplified process.
Last updated