Signals
@kamod-ch/signals
Persistence built in
persistedSignal and usePersistedSignal sync reactive values to the driver you choose.
Framework friendly
Works beside Preact components and plain modules — share state across controllers without prop drilling.
SSR-aware cookies
createCookieContext and serializeCookie helpers keep cookie-backed signals usable on the server.
Installation
Install @kamod-ch/signals with @preact/signals and Preact as peer dependencies when using the package outside the Kamod UI monorepo.
pnpm add @kamod-ch/signals @preact/signals preactUsage
Create a persisted signal with a storage key and driver, then read or write .value as usual. Use usePersistedSignal inside components for scoped instances.
import { persistedSignal } from "@kamod-ch/signals";
export const theme = persistedSignal("theme", "dark", { storage: "local" });
// later
theme.value = "light";API Reference
This page is a Kamod UI overview. Full API docs, driver tables, and SSR cookie examples live on the dedicated kamod-signals docs.
Accessibility Notes
When signals drive UI chrome (theme, sidebar, locale), reflect state in accessible controls and keep preference changes predictable for keyboard and assistive tech users.