Foldkit is becoming Effect’s full-stack application framework.
Active frontend development is happening in Effect UI, now in public preview. Effect UI will be Foldkit’s frontend foundation.
Foldkit 0.x architecture
The docs and examples below cover the Foldkit 0.x architecture for state, effects, and views.
Predictable state
One immutable model holds your entire application state. Every change flows through a single update function. No hidden mutations, no stale closures, no surprises.
Explicit effects
Side effects are values you return from update, not imperative calls buried in handlers. Commands describe what should happen. The runtime handles when and how.
Shared structure
A 50-file application uses the same Model, Message, update, and Command structure as a 5-file application. New work has a known place, and reviews start from shared conventions.
Watch your program think.
DevTools logs every Message and lets you inspect each Model state. Select a Message to see what changed, or rewind the UI to that state.
The same runtime data is available to AI agents over MCP. They can inspect the current Model, walk Message history, rewind the UI to past states, and dispatch Messages.
This site runs on Foldkit. Look for the tab on the bottom right of this page to try DevTools live.
Learn about DevToolsBuilt on Effect. Inside and out.
If your backend already uses Effect, Foldkit carries the same tools and patterns into the browser. If Effect is new to your team, it is part of the learning curve.
- Every Foldkit application is an Effect
- The entire Model is defined by Schema
- Commands use Effect for services, interruption, resources, and concurrency
Tests that just make sense.
Pure update functions mean pure tests. Story tests the state machine. Scene tests features through the view (clicking buttons, typing into inputs) with accessible locators. No DOM, no mocking.
Learn about testingExample applications.
One architecture, many kinds of software. Open any example to run it, see how it is modeled, and read the source.
Generative Art
State Machine
Pixel Art
WebSocket Chat
Kanban
Map
Snake
UI Showcase
Job Application
Charting
Counter
Counters
Todo
Stopwatch
Crash View
Slow Warnings
Form
Weather
API Cache
API Cache Query
Routing
Route Transitions
Interrupting Commands
View Transitions
Query Sync
Auth
Shopping Cart
Managed Resource Layer
Canvas Art
Web Components
Embedding
Static Site Generation
Server-Side Rendering
Personal Blog
LiveStore
Typing Terminal
- Explore the catalog
Batteries included.
Routing, server rendering, UI components, composition, and browser lifecycles all use the same Model and Message flow.
Routing
Type-safe bidirectional routing. URLs parse into typed routes and routes build back into URLs. No string matching, no mismatches between parsing and building.
Explore routingServer Rendering
Generate static HTML at build time or render each request. Both paths use the same init, view, and Model, then hydrate the HTML in the browser.
Explore server renderingUI Components
Accessible dialogs, menus, tabs, listboxes, disclosures, and more. Each stateful component follows The Elm Architecture and stays open to styling and composition.
Browse the componentsSubmodels
A Submodel embeds its own Model, Messages, update, and view in a larger program. It sends domain facts to its parent as typed OutMessages. Every stateful Foldkit UI component is a Submodel.
Explore SubmodelsBrowser Lifecycles
Subscriptions stream events while a Model condition holds. ManagedResources hold handles such as WebSockets and AudioContext. Foldkit closes both when the Model no longer needs them.
Explore browser lifecyclesEmbedding
Run a Foldkit widget inside any host application with Runtime.embed. The host pushes data in and receives values out through Schema-typed Ports, and tears the widget down with dispose.
Explore embeddingSee it work.
Watch a message flow through update into the model. The code highlights in real time to show you what’s happening at each step.
Working with Foldkit 0.x
Foldkit 0.x uses The Elm Architecture. Application state does not live in component instances or hook lifecycles. The Model is the single source of truth, and every transition stays visible in update.
The same Model and update loop drive the application in the browser and during server rendering.
Application patterns
Sharing Effect services
Foldkit carries Schema, services, Streams, and scoped resources into the frontend.
Applications with complex state
Auth flows, real-time data, and multi-step forms become explicit states and transitions instead of effects and refs spread across the tree.
Shared conventions across features
One pattern for state, effects, and views gives features a known shape and reviews a common vocabulary.
Integration options
Existing React codebases
Runtime.embed lets you run a Foldkit widget inside a React application.
Server-rendered routes
Render a route for each request, then hydrate it in the browser.
Static deployments
Prerender routes at build time and serve the generated HTML from a static host.
Foldkit 0.x project status
We no longer recommend starting new projects with Foldkit 0.x. We’ll keep fixing critical bugs in Foldkit 0.x at least until Effect UI ships with an upgrade guide.
Version
v0.171.1
Example apps
36Production app
Typing TerminalChangelog
View releases
For agent productivity. And human understanding.
Agents can use Foldkit’s consistent architecture to build features and inspect running apps through MCP. People can trace the same Model and Message flow to understand, review, and test the result.
Set up AI-assisted developmentFoldkit 0.x resources
Find documentation, API references, and examples for existing Foldkit applications.