pillarjs

1.0.0-beta2 • Public • Published

PillarJS

"Batteries-included" library for Web Components inspired by React.

Getting started

Getting started with Pillar is extremely easy.

  1. Install Babel preset:

    npm install --save-dev babel-preset-pillar
    

    and add it to your .babelrc:

    {
        "presets": ["pillar"]
    }
  2. Create a component:

    import Pillar from 'pillarjs';
     
    class SuperHeader extends Pillar {
        render(props) {
            return (
                <div>
                    <h1>{props.mainContent}</h1>
                    <h1>It's Superpowered!</h1>
                </div>
            );
        }
    }
     
    Pillar.register(SuperHeader, 'super-header');
  3. Use it in your HTML:

    <main>
        ...
        <super-header main-content="It's not a simple    header."></super-header>
        ...
    </main>

The resulting HTML will be:

<div>
    <h1>It's not a simple header.</h1>
    <h1>It's Superpowered!</h1>
</div>

Documentation

Check out the docs to learn about rendering from strings and template tags, alternative build configurations and everything else.

Readme

Keywords

none

Package Sidebar

Install

npm i pillarjs

Weekly Downloads

0

Version

1.0.0-beta2

License

MIT

Last publish

Collaborators

  • fivepointseven