---
title: "LemonadeJS v6 Documentation and API Reference"
description: "The LemonadeJS v6 book: what each piece of the architecture is, the problem it solves, how it compares to React, Vue and Angular, and measured examples."
source: https://lemonadejs.com/docs/
---

# LemonadeJS documentation

This is the documentation for LemonadeJS v6, a **micro JavaScript framework
for AI agents**: ~9 KB gzip,
zero dependencies, zero build step, designed for the shortest *verified* loop
from intent to working component, whether the author is a human or an AI agent.

This documentation is written as a book. Every chapter follows the same
discipline: **what it is, the problem it solves, how it compares to
React, Vue and Angular (honestly), and real examples with measured receipts**.
The numbers quoted come from the test and probe suites that gate the
repository; nothing here is promised that is not proven.

## Part I: The Idea

* [Why v6 exists](/docs/motivation/): the agent-first thesis, the error-profile
  argument, and the receipts
* [When NOT to use LemonadeJS](/docs/when-not/), the honest page: SSR,
  ecosystem depth, compile-time optimization, and the costs of the design
* [Getting started](/docs/getting-started/): first component in one file,
  no build step

## Part II: The Engine

* [Templates, the four rules](/docs/templates/): the entire template
  language fits in four rules
* [State, mutable by design](/docs/state/): assignment notifies, mutation
  is free; the 100,000-row receipts
* [computed(), derived state](/docs/computed/), and the two bug classes
  it eliminates
* [Events](/docs/events/): one casing rule, real functions, CSP-safe
* [Attributes](/docs/attributes/): atomic attribute updates, data-*
  variants, why class concatenation bugs are structurally impossible
* [Lists](/docs/lists/): keys, live component patching, and touch()
  propagation through by-reference props
* [Styling](/docs/styling/) covers css() values and component-owned `<style>`:
  the single-file component story
* [Two-way binding](/docs/two-way-binding/): the bind directive and the
  bind() tool
* [Refs](/docs/refs/): callback refs and useRef-style object refs, nulled
  on disposal
* [Components and composition](/docs/components/): by value, by name, and
  children
* [Lifecycle and listeners](/docs/lifecycle/): onMount, onUnmount,
  listen(), self-unmount
* [Destroy](/docs/destroy/), the chapter most frameworks don't write:
  structural destruction, isDisposing(), heap-snapshot receipts
* [Store](/docs/store/): module-scope shared state without a state-management
  library
* [Async data](/docs/async/) covers resource(): tracked fetchers, abort-previous,
  latest-wins
* [Errors that teach](/docs/errors/): stable LJS codes and explain()
* [Debugging](/docs/debugging/): trace() causality as data, LJS-205
  containment, inspect()

## Part III: Publishing

* [Contracts](/docs/contracts/) covers component(name, contract, fn): one
  declaration, every deployment
* [Deployments](/docs/deployments/), one block in three forms: by value, by
  name, custom element
* [Web components](/docs/web-components/): live attributes, element
  properties, destroy-by-default
* [Using with React](/docs/react/): adaptReact(), tested against real
  React 18 StrictMode
* [Forms](/docs/forms/) covers form() with $get/$set: states ARE the storage
* [Sugar](/docs/sugar/): singleton services with closed internals
* [Testing and verification](/docs/tests/): the harness, verify(), and the
  real-browser probe discipline

## Part IV: The Studio

* [The Studio](/docs/studio/): 43 contract-verified blocks, the Modal
  primitive, and composition as architecture
* [Building a block](/docs/building-blocks/): the recipe that built the
  catalog, including the agent workflow
* [For AI agents](/docs/agents/): contracts, llms.txt, and the verified loop

## Archive

Previous major versions remain available: [v5](/docs/v5/),
[v4](/docs/v4/), [v3](/docs/v3/).