clay.js
  1. ClayJS
  2. ClayJS docs

ClayJS docs

Documentation for ClayJS, the browser library that turns one HTML file into a malleable document that edits, saves, and syncs itself.

ClayJS is the free, open-source browser library that turns one HTML file into a malleable document. Add one script tag to an HTML page, and the page edits itself in place, saves the updated HTML back to its host, and merges changes across open tabs and collaborators. Every malleable document on Hyperclay, HTML Clay, and Hyperclay Local is built with ClayJS.

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#