4.0.0-0 • Published 6 years ago

@biotope/element v4.0.0-0

Weekly downloads
174
License
MIT
Repository
github
Last release
6 years ago

Biotope Element

Build Status codecov

Installation

You can install the biotope element in your project using npm

npm install @biotope/element --save

or yarn

yarn add @biotope/element

After that to use it, import it in your project:

import Component from '@biotope/element';

Usage

To use the biotope element, you have to extend it with your custom class:

import Component from '@biotope/element';

export class MyButton extends Component {
  public static componentName = 'my-button';
  
  public render(): HTMLFragment {
    return this.html`
      Hello World
    `;
  }
}

After defining your class which you can do using existing methods (link) you have to call register on the class itself to use it in a javascript/typescript file:

import Component from '@biotope/element';

export class MyButton extends Component {
  render() {
    return this.html`
      Hello World 🐤
    `;
  }
}

MyButton.componentName = 'my-button';
MyButton.register();

/////////////////////////////////////////////

// typescript
import Component from '@biotope/element';

export class MyButton extends Component {
  public static componentName = 'my-button';

  public render(): HTMLFragment {
    return this.html`
      Hello World 🐤
    `;
  }
}

MyButton.register();

After that you can use it in your html like so:

<script src="my-button.js"></script>
<my-button></my-button>

This will result in the following html:

<my-button>
  Hello world 🐤
</my-button>

Polyfills

Webcomponents

Webcomponents are not supported by all browsers. Even the newest browsers have not integrated the spec yet. To still be able to use biotope element in your project in all major browsers, please include the webcomponent polyfills in your project. Here is the NPM package.

Documentation

You can find the documentation here.

In order to contribute to the documentation you can start a local server with npm start and then start editing the files in docs.

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.1.1

6 years ago

4.0.0

6 years ago

4.0.0-6

6 years ago

4.0.0-5

6 years ago

4.0.0-4

6 years ago

4.0.0-3

6 years ago

4.0.0-2

6 years ago

4.0.0-1

6 years ago

4.0.0-0

6 years ago

3.2.0

6 years ago

3.2.0-0

7 years ago

3.1.0-0

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1-alpha.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.8.3

7 years ago

1.8.2

7 years ago

1.8.1

7 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago