Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
Forked from UpperCod/hello.js
Created January 15, 2023 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinandersen3d/55b38d44a621887f11e6fc38b5416d11 to your computer and use it in GitHub Desktop.
Save martinandersen3d/55b38d44a621887f11e6fc38b5416d11 to your computer and use it in GitHub Desktop.
atomico-example
import { c, html } from "atomico"; // 3.0kB
function component({ name }) {
return html`<host shadowDom>Hello, ${name}</host>`;
}
component.props = {
name: String,
};
customElements.define("my-component", c(component));
import { c } from "atomico"; // 2.5kB
function component({ name }) {
return <host shadowDom>Hello, {name}</host>;
}
component.props = {
name: String,
};
customElements.define("my-component", c(component));
import { Props, c, html } from "atomico"; // 3.0kB
function component({ name }:Props<component.props>) {
return html`<host shadowDom>Hello, ${name}</host>`;
}
component.props = {
name: String,
};
customElements.define("my-component", c(component));
import { Props, c } from "atomico"; // 2.5kB
function component({ name }:Props<component.props>) {
return <host shadowDom>Hello, {name}</host>;
}
component.props = {
name: String,
};
customElements.define("my-component", c(component));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment