Skip to content

Instantly share code, notes, and snippets.

@UpperCod
Last active January 15, 2023 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save UpperCod/1b90dcc0628da914ab8c1e077c4d3b56 to your computer and use it in GitHub Desktop.
Save UpperCod/1b90dcc0628da914ab8c1e077c4d3b56 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