0.1.8 • Published 2 years ago

@aegis-framework/pandora v0.1.8

Weekly downloads
13
License
MIT
Repository
gitlab
Last release
2 years ago

Pandora

Pandora is a Web Components library that allows you to create simple and reusable custom HTML elements.

Components

// Create a new Component
class CustomElement extends Pandora.Component {

	constructor () {
		super ();

		// Add a text property
		this.props = {
			text: ''
		};
	}

	render () {
		// When rendered, this component will show an h2 element with the text
		// given on the props.
		return `<h2>${this.props.text}</h2>`;
	}
}

console.log (CustomElement.tag); // custom-element

// Register the custom element with its tag on the window and add the CustomElement
// class as its controller
window.customElements.define (CustomElement.tag, CustomElement);

// Get the custom element from the DOM
const element = document.querySelector ('custom-element');

// Set its text to Hello World!
element.setProps ( {
	text: 'Hello World!'
});

Documentation

You can find alll the documentation for this library at https://developers.aegisframework.com/pandora/

License

This library is released under a MIT License

0.1.8

2 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago