~repos /atoms-element

#js

git clone https://pyrossh.dev/repos/atoms-element.git

A simple web component library for defining your custom elements. It works on both client and server.



file:

example/elements/app-total.js



import { createElement, html, useReducer } from '../../index.js';
import { totalReducer } from '../store.js';
const Total = () => {
const { total } = useReducer(totalReducer);
return html`
<div class="m-20">
<h1 class="text-xl font-mono">Total of 2 Counters: ${total}</h1>
</div>
`;
};
export default createElement(import.meta, Total);