Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.08 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.08 KB

English | 简体中文

omi

Omi - Web Components Framework

  • 📶 Signal-driven reactive programming
  • 🌐 Web Components + JSX for streamlined component-based development
  • 💒 Harness Constructable Stylesheets to easily manage and share styles
import { render, signal, tag, Component, h } from 'omi'

const count = signal(0)

function add() {
  count.value++
}

function sub() {
  count.value--
}

@tag('counter-demo')
class CounterDemo extends Component {
  static css = 'span { color: red; }'

  render() {
    return (
      <>
        <button onClick={sub}>-</button>
        <span>{count.value}</span>
        <button onClick={add}>+</button>
      </>
    )
  }
}

render(<counter-demo />, document.body)

Install

npm i omi@7.0.0-alpha0

Contributors

License

MIT © Tencent