@kocisov/crab
JavaScript library for building user interfaces with Custom Elements, Shadow DOM and React like API.
Last updated a year ago by kocisov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @kocisov/crab 
SYNC missed versions from official npm registry.

JavaScript library for building user interfaces with Custom Elements, Shadow DOM and React like API.

npm Code Climate

This version of Crab was written in TypeScript to include Types for your development

How does it look

import { Component, defineComponents, render } from '@kocisov/crab'

export default class Header extends Component {
  // or Polymer like => static get is()
  static get componentName() {
    return 'header-component'
  }

  state = {
    id: 'Some string...',
  }

  changeState() {
    this.setState({
      id: uuid.v4(),
    })
  }

  render() {
    return `
      <div class="flex-right">
        Hello ${this.state.id}
      </li>
    `
  }
}

defineComponents([Header, SmallButon], { crabug: true })

render(
  `
    <header-component onClick="changeState"></header-component>
  `,
  `
    body {
      margin: 0;
    }
  `,
  document.getElementById('root'),
)

Installation

This version of Crab is compiling from ES2015+ to ES5 ready even without native-shim.

Install crab with package manager
# yarn
yarn add @kocisov/crab

# npm
npm install --save @kocisov/crab
Include crab into your code
// webpack with babel
import { Component, defineComponents, render } from '@kocisov/crab'

// ...

render(
  `
    <view-layout></view-layout>
  `,
  document.getElementById('root'),
)

Docs

Work in progress at docs.

Current Tags

  • 0.2.2                                ...           beta (a year ago)
  • 0.3.3                                ...           latest (a year ago)

9 Versions

  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           2 years ago
  • 0.2.0-beta.3                                ...           2 years ago
  • 0.2.0-beta.2                                ...           2 years ago
  • 0.2.0-beta.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 5
Last Day 0
Last Week 4
Last Month 16
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |