Skate is a functional reactive abstraction over the web component standards as a set of packages that enables you to write small, fast and scalable web components using popular view libraries such as React, Preact and LitHTML.
- 🌏 Cross-framework compatible components.
- ⚛️ Render components using your favourite view library, or none at all.
- 👑 Guided conventions for best-practices when reflecting between, and reacting to attributes, properties and events.
- 🌟 Full TypeScript support.
- 📚 Docs https://skatejs.netlify.com.
The simplest way to get up and running is to start with a pre-configured element such as @skatejs/element-lit-html
.
npm i @skatejs/element-lit-html
import Element, { html } from '@skatejs/element-lit-html';
export default class extends Element {
static get props() {
return {
name: String
};
}
render() {
return html`
Hello, ${this.name}!
`;
}
}
There's a CLI to get you up and running: https://skatejs.netlify.com/packages/cli.
$ npm i -g @skatejs/cli
$ skatejs
Skate builds upon the
Custom Elements and
the Shadow DOM standards.
It is capable of operating without the Shadow DOM — it just means you
don't get any encapsulation of your component's HTML or styles. It also means
that it's up to you to provide a way to project content (i.e. <slot>
). It's
highly recommended you use Shadow DOM whenever possible.
Though most modern browsers support these standards, some still need polyfills to implement missing or inconsistent behaviours for them.
For more information on the polyfills, see the web components polyfill documentation, emphasis on the caveats.
Skate supports all evergreens and IE11, and is subject to the browser support matrix of the polyfills.
Support us with a monthly donation and help us continue our activities. Become a backer!
Become a sponsor and get your logo on our README on Github with a link to your site. Become a sponsor!