Skip to content

About

Foldkit Plus: packages for Foldkit apps. Server data (Remote), local-first sync, routing (Site), SSR, forms, CRUD, a CMS, rich text, a page builder, and AI agents over MCP and WebMCP.

Topics

Resources

Contributing

Security policy

Stars

40 stars

Watchers

1 watching

Forks

Latest commit

 

History

6,449 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foldkit-plus

An application starts clean, then its state splinters. A fetch hook caches server rows, a URL store holds the active filter, a sync layer grows its own reducer, and an agent handler re-implements transitions. Soon those copies disagree.

Foldkit keeps UI state in one state machine: one typed Model (your application state), a Message union (everything that can happen), and one pure update function that produces the next Model. Foldkit Plus extends that state machine to the rest of your app without adding a second store. Server data reconciles into the Model, offline edits replay through update, the URL mirrors Model fields, and agents only send Messages your application already handles.

Try the live demos

See the packages running at foldkit-plus.pages.dev. Server-backed demos run their server inside your browser, shared across tabs, so nothing leaves your machine:

Which package do you need?

What you want to do Package Guide
Keep filters or drafts in the URL or storage foldkit-mirror Mirrored state
Cache server data and mutate optimistically foldkit-remote Server-derived state
Sync offline edits across devices and tabs foldkit-sync, foldkit-durable Replicated state
Edit server rows offline through a journal foldkit-sync, foldkit-remote Editing server data
Let an AI agent use your app via MCP or A2A foldkit-agent Agents
Share one data schema across DB, cache, and forms foldkit-entity One domain declaration
Enforce read and write permissions everywhere foldkit-guard Guard README
Build forms and CRUD screens from a schema foldkit-form, foldkit-crud Form README
Use accessible, themed UI widgets foldkit-mixins-ui Widget catalog
Style or extend views without forking markup foldkit-mixins View composition
Reuse a child state machine in many places foldkit-bundle Bundle README
Render on the server and resume in the browser foldkit-ssr SSR README
Edit rich text or a 100,000-row data grid foldkit-richtext, foldkit-data-grid Rich text

For the rest of the catalog—including foldkit-surface, foldkit-primitives, foldkit-cms, foldkit-media, foldkit-site, foldkit-host, and foldkit-react—see the documentation map.

Keep a filter in the URL without a second store

To connect an extension without a second store, foldkit-surface wraps your Model, Message, and update so extensions can point at Model fields by name. Below, foldkit-mirror binds filter and page to the URL and reads query strings back into the Model:

import { Schema } from 'effect'
import { defineMessageUnion } from 'foldkit/message'
import { modifyFields } from 'foldkit/struct'
import { Surface } from 'foldkit-surface'
import { Mirror } from 'foldkit-mirror'

const Filter = Schema.Literals(['all', 'active', 'done'])
const Model = Schema.Struct({ filter: Filter, page: Schema.Number })
const Message = defineMessageUnion({ ChangedFilter: { filter: Filter } })
const initial = { filter: 'all', page: 1 } as const
const update = (model: typeof Model.Type, message: typeof Message.Type) =>
  Message.match(message, {
    ChangedFilter: ({ filter }) => ({ model: modifyFields(model, { filter: () => filter }) }),
  })

const App = Surface.application({ Model, Message, initial, update })
const Filters = Mirror.url(App, { name: 'filters', fields: [App.model.filter, App.model.page] })

const active = Filters.urlChanged(initial, '/todos?filter=active&page=2')
const next = update(active, Message.ChangedFilter({ filter: 'done' })).model
console.log(active)
console.log(Filters.href(next))
console.log(Filters.href(initial))

What happened when this ran:

{ filter: 'active', page: 2 }
/?filter=done&page=2
/

Filters.urlChanged reads the query string back into your Model ({ filter: 'active', page: 2 }). After update sets filter to 'done', Filters.href(next) builds /?filter=done&page=2, while Filters.href(initial) drops default values back to /. Your Model owns both fields and update remains the only place they change.

Install

Run the setup command to check your effect and foldkit versions, print the install command for your package manager, and optionally install the coding-agent skill:

npx --legacy-peer-deps foldkit-plus setup

Or install the umbrella package directly with pnpm (every package is also published on its own):

pnpm add foldkit-plus

Where to go next

MIT license. These are community packages for Foldkit and are not affiliated with or endorsed by the Foldkit maintainers.

About

Foldkit Plus: packages for Foldkit apps. Server data (Remote), local-first sync, routing (Site), SSR, forms, CRUD, a CMS, rich text, a page builder, and AI agents over MCP and WebMCP.

Topics

Resources

Contributing

Security policy

Stars

40 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages