A Simple Component gzip 1.32 kB

A familiar example which needs little explanation.

The only thing to point out here is that the html tag is compiled to h function calls by the awesome HTM library. This can be done either at runtime or build time.

import { html } from 'sinuous';

const HelloMessage = ({ name }) => html`
<!-- Prints Hello World -->
<div>Hello ${name}</div>
`
;

document.querySelector('.hello-example').append(
html`<${HelloMessage} name=World />`
);