boreDOM

Documentation

Quickstart

As an alternative do it by hand

Copy boreDOM.js to your folder. Create an index.html.

<script src="./boreDOM.js"></script>

Anatomy of a Component

A boreDOM component is just three HTML tags sharing a data-component name. These are typically a <template>, and optional <style> and <script>

1. The Template

<template data-component="my-button">
  <button data-dispatch="clickMe">
    Clicked <span data-text="local.clicks">0</span> times
  </button>
</template>

2. The Style (Optional)

<style data-component="my-button">
  button { background: hotpink; }
</style>

3. The Logic (Optional)

<script type="text/boredom" data-component="my-button">
  export default ({ on, local }) => {
    local.clicks = 0;
    on("clickMe", () => local.clicks++);
  };
</script>

API Reference

Directives

Put these on your HTML elements. They bind things.

Logic Arguments

Your exported function receives an object with these tools:

CLI & Tooling

The CLI is designed to steer LLMs and validate their output.

boredom init

npx @mr_hugo/boredom init [directory] [flags]

Scaffolds a new project.

boredom validate

npx @mr_hugo/boredom validate [file]

Validates your single-file application.

← Back to the void