Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/josnin/libweb

libweb is a library for building Web Components
https://github.com/josnin/libweb

fastify nodejs typescript webcomponent

Last synced: 3 months ago
JSON representation

libweb is a library for building Web Components

Awesome Lists containing this project

README

        

# libweb is a library for building [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)

* Template syntax
* Data binding
* Event handling

## Use directly in browser

```html





class BindingComponent extends LWElement {
__reactive = { username: 'darling' };
__template = `<input data-bind="username" type="text"/> {username}`;
}
customElements.define('app-root', BindingComponent);

```

## Create Events
```js
import { LWElement } from 'libweb.js';

class EventComponent extends LWElement {

firstname = 'Johny'; // non reactive variable
__template = `Click Sample event`

alertMe(arg) {
alert(`Hello ${arg}`);
}

}

customElements.define('sample-event', EventComponent);

```
### index.html
```html

```

## Installation
```
npm install
```

## How to run development server?
```
cd ~/Documents/libweb/
npm run build
npm start
```

### Help

Need help? Open an issue in: [ISSUES](https://github.com/josnin/libweb/issues)

### Contributing
Want to improve and add feature? Fork the repo, add your changes and send a pull request.