Skip to content

Nemesia guide ​

This guide explains Nemesia from first mount to production cleanup. It is written for developers integrating behavior into HTML rendered by a backend, static-site generator, or CMS.

Start here ​

  1. Getting started — install Nemesia and mount a first component.
  2. HTML contract — understand roots, refs, options, and nested ownership.
  3. Applications and registration — create an app and control its scope.
  4. Concrete components — define class-based behavior and root constraints.

Component APIs ​

  1. Refs — request required, optional, and repeated elements.
  2. Options — parse typed values from root attributes.
  3. Events and lifecycle — attach listeners and release resources.

Advanced usage ​

  1. Dynamic DOM observation — support content added or removed after initial mount.
  2. Distributed components — attach delegated behavior to an app scope.
  3. TypeScript and diagnostics — public exports, warnings, errors, and bundles.
  4. Recipes — practical patterns for common website interactions.

Mental model ​

Nemesia has deliberately narrow responsibilities:

  • HTML comes from somewhere else.
  • A component class describes behavior for one existing root.
  • Fields request the refs and options that behavior needs.
  • Invalid markup skips only the invalid instance.
  • The app owns mounted instances and cleans them up deterministically.

If a page needs client-side templates, routing, stores, or reactive rendering, use a framework designed for those jobs. Nemesia is designed as the layer between server HTML and repetitive vanilla JavaScript code.

Back to project README