@futura/html
TypeScript icon, indicating that this package has built-in type declarations

0.4.0-alpha.10 • Public • Published

Futura HTML

HTML Elements for Futura.

Examples

import { button, div, attributes, events } from "@futura/html";
const { classes } = attributes;
const { onClick } = events;

type State = number;

const view = (state: State) =>
  div([class_("counter")],
    button([ class_("counter-button"), onClick(() => new Decrement()) ], "-"),
    div([ class_("counter-value") ], `${state}`),
    button([ class_("counter-button"), onClick(() => new Increment()) ], "+"),
  );

Calling view(100) will result in the following virtual DOM node:

<div class="counter">
  <button class="counter-button">-</button>
  <div class="counter-value">100</div>
  <button class="counter-button">+</button>
</div>

Package Sidebar

Install

npm i @futura/html

Weekly Downloads

1

Version

0.4.0-alpha.10

License

Apache-2.0

Unpacked Size

225 kB

Total Files

20

Last publish

Collaborators

  • asabil