skatejs-types

Attribute / class binding type.

Usage no npm install needed!

<script type="module">
  import skatejsTypes from 'https://cdn.skypack.dev/skatejs-types';
</script>

README

Binding types for SkateJS

This repository contains binding types for SkateJS components. Included types are:

attribute

A binding for using attribute names to identify a component.

<div attribute-name></div>
skate('attribute-name', {
  type: skateTypes.attribute
});

Attributes are a great way to mix in functionality but lack the explicitness of tag names, or the is attribute. Use attribute names when:

  • You have functionality that you want to declaratively mix-in to your element.
  • Your component won't conflict with other components on the same element.
  • Your component does not template the element.
  • You are converting legacy components to Skate components and for whatever reason you can't change the markup.

classname

A binding for using class names to identify a component.

<div class="class-name"></div>
skate('class-name', {
  type: skateTypes.classname
});

Class names are the least preferred method of binding behaviour to an element because generally, classes are for styling, not behaviour. There are however some cases where this can be helpful. You should try to only use class names when:

  • You are converting legacy components to Skate components and for whatever reason you can't change the markup.