lastriko
v0.2.0
Published
TypeScript UI toolkit for AI demos and rapid prototyping (server-rendered HTML + WebSocket).
Maintainers
Readme
lastriko
Server-driven UI for AI demos and rapid prototypes: your TypeScript app() builds handles, the engine renders HTML fragments, and the browser swaps outerHTML over a WebSocket.
Install
npm install lastrikoRequires Node.js 22+. Bun is also supported.
Quick start
import { app } from 'lastriko';
await app('Hello', (ui) => {
const name = ui.textInput('Name');
const out = ui.text('Hi!');
ui.button('Greet', () => {
out.update(`Hello, ${name.value || 'stranger'}!`);
});
});Run with tsx or bun; open the URL printed in the console (default port 3500).
Exports
- JS API —
import { app, defineConfig } from 'lastriko' - Styles —
import 'lastriko/style.css'(or load/style.cssfrom the dev server)
Docs
Examples in this repo
examples/component-gallery— all MVP components on one pageexamples/experiment-monitor,examples/image-viewer— larger demos
Publishing (maintainers)
From the monorepo root, after tests pass:
npm run build -w lastriko
npm publish -w lastriko --access publicprepack runs build automatically on npm publish.
License
MIT — see LICENSE in the repository root.
