clay.js
  1. ClayJS
  2. ClayJS docs

ClayJS docs

Documentation for ClayJS, the browser library that lets one HTML file edit, save, and sync itself.

ClayJS is a free, open source browser library for HTML files. Add one script tag to let the file edit itself in place and save changes back to a host like Hyperclay, HTML Clay, or Hyperclay Local. With the sync plugin, it merges edits from other tabs, people, and AI agents while the file stays plain HTML.

If you build with an AI coding agent, give it the problem list, so it reads only the pages the task needs. The one-file Markdown guide stays available for the details.

Why ClayJS exists#

Reusable, portable, free, open-source software that anyone can use and improve on their own needs a lightweight visual and data format. The HTML file is a natural fit because it holds markup, styles, scripts, and data in one file and gives you the full web platform.

On its own, an HTML file cannot save changes back to itself. ClayJS makes the live DOM both the application and the record. Durable state lives in the HTML as elements, attributes, text, and persisted form controls, while temporary editing controls are stripped before each save. You can update an HTML file like a web application on the web or on your own computer, and email it around as a portable file.

What people build with ClayJS#

  • AI question forms: An AI agent builds a form to ask you questions, and your answers save back into the HTML file so you never lose them.
  • Screenshot feedback tools: A feedback tool built into the document lets you mark up screenshots. Your notes stay in the file so your AI agent can read them straight from the HTML.
  • Project dashboards: For multi-week projects, an AI agent creates a dashboard and keeps it updated through the document’s JSON API.
  • Daily work journals and diagrams: Single-file journals for client work, to-dos, finished tasks, and project planning, along with editable diagrams.
  • Single-file applications: Kanban boards, block writers, finance trackers, flashcards, and reading lists. Everything lives in one HTML file under your control.

Where to start#