skatejs/skatejs

JavaScriptskatejs.netlify.com

Effortless custom elements powered by modern view libraries.

web-componentsreactiveuijavascript
Star 增长趋势
Star
3.3k
Forks
136
周增长
+0
Issues
24
1k2k3k
2014年2月2018年4月2022年6月2026年8月
制品库npm
README

Skate

Build Status Downloads per month Join the chat at https://gitter.im/skatejs/skatejs Follow @skate_js on Twitter

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.

Getting started

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

Simple example

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}!
    `;
  }
}

Other examples

  1. Todo list

Cli

There's a CLI to get you up and running: https://skatejs.netlify.com/packages/cli.

$ npm i -g @skatejs/cli
$ skatejs

Polyfills

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.

Browser Support

Skate supports all evergreens and IE11, and is subject to the browser support matrix of the polyfills.

Backers

Support us with a monthly donation and help us continue our activities. Become a backer!

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. Become a sponsor!

相关仓库
storybookjs/storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

TypeScriptnpmtutorialMIT Licensestorybookstyleguide
storybook.js.org
91k10.4k
Tencent/omi

Web Components Framework - Web组件框架

TypeScriptnpmOtheromijsx
omi.cdn-go.cn
13.3k1.3k
material-components/material-web

Material Design Web Components

SCSSApache License 2.0component-design-system
material-web.dev
11.2k1.1k
rough-stuff/wired-elements

Collection of custom elements that appear hand drawn. Great for wireframes or a fun look.

TypeScriptnpmlibraryMIT Licensewebcomponentslit-element
wiredjs.com
10.8k341
microsoft/fast

The adaptive interface system for modern web experiences.

TypeScriptnpmOtherdesign-systemsdesign-architecture
fast.design
9.7k635
andreasbm/web-skills

A visual overview of useful skills to learn as a web developer

JavaScriptnpmskillOtherhtmlcss
andreasbm.github.io/web-skills/
7.6k716
vmware-archive/clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.

TypeScriptnpmMIT Licenseuxui
clarity.design
6.4k728
microsoft/fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications

C#libraryMIT Licensecomponentsdesign-systems
fluentui-blazor.net
4.8k484
capricorn86/happy-dom

A JavaScript implementation of a web browser without its graphical user interface

TypeScriptnpmMIT Licensejavascripttypescript
4.6k320
zdhxiong/mdui

Material Design 3(Material You) UI components using Web Components.

TypeScriptnpmcssjavascript
mdui.org
4.5k376
openui/open-ui

Maintain an open standard for UI and promote its adherence and adoption.

MDXOtheruiux
open-ui.org
4.5k225
github/relative-time-element

Web component extensions to the standard <time> element.

JavaScriptnpmlibraryMIT Licenseweb-componentscustom-elements
github.github.io/relative-time-element/examples/
4k192