2.0.1 • Published 5 years ago

panda-play v2.0.1

Weekly downloads
75
License
MIT
Repository
github
Last release
5 years ago

Play

Play is a lightweight library for building Web Components.

To create a component, you just call gadget:

import {Gadget, bebop, shadow, template, events} from "panda-play"

mixin class extends Gadget, [

  tag "x-greeting"

  # bebop preset gives us VDOM + automatic rendering
  # shadow give us Shadow DOM support
  bebop, shadow

  template ({value}) -> "<h1>#{value}, World!</h1>"

  events
    h1:
      click: ({target}) -> @value = "Goodbye"

Features

  • Fully encapsulated native Web Components
  • Virtual DOM, with diff-based updates
  • Selector-based event handlers instead of inline
  • Arbitrary template functions—use template literals, JSX, Pug, …
  • Or use VHTML and generate VDOM directly
  • Observable properties generate change events and re-render
  • Component-targetable CSS from client document
  • Pipe operator to wire components together
  • Delegation pattern—Gadgets are handles to DOM elements
  • Mixin-based composition avoid fragile base class problem

Install

Bundle using your favorite bundler:

npm i -S panda-play
2.0.1

5 years ago

2.0.0

5 years ago

1.8.6

5 years ago

1.8.5

5 years ago

1.8.4

5 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago