TypedLoom is a visual schema builder and code generator for TypeScript and Zod.
Paste JSON, visually refine your schema, and generate type-safe code in seconds.
🔗 Live demo: https://typed-loom.vercel.app/editor
-
Visual JSON & Schema Editor
- Paste existing JSON or start from scratch.
- Explore and edit your data structure in a tree view.
- Rename fields, toggle optional (
?), and tweak types without hand-editing JSON.
-
Advanced Type Builder
- Union Types: Create unions like
string | numberdirectly from the UI. - Literal Types: Manage literal unions such as
"active" | "inactive"or1 | 2with a tag-based interface. - Type Overrides: Override inferred types (e.g.
string→UserId) and keep everything in sync.
- Union Types: Create unions like
-
Real-time Code Generation
- Instantly generate:
- ✅ TypeScript interfaces / type aliases
- ✅ Zod schemas for runtime validation
- Tree view edits are reflected live in the generated code.
- Instantly generate:
-
Smart JSON Editor
- Full-featured JSON editor with:
- Syntax highlighting
- Error reporting
- Auto-formatting & repair (powered by
jsonrepair)
- Works great as a “Paste API response → Fix → Convert” flow.
- Full-featured JSON editor with:
-
Privacy First
- All processing happens entirely in your browser.
- No data is sent to any server – ideal for private or internal API payloads.
Given JSON like this:
{
"id": 1,
"name": "Alice",
"status": "active",
"tags": ["admin", "beta"],
"profile": {
"email": "[email protected]",
"age": 30
}
}
TypedLoom lets you:
- Paste this JSON into the editor.
- Use the tree view to:
- Rename
profile→userProfile - Mark
ageas optional - Turn
statusinto a literal union ("active" | "inactive" | "banned").
- Rename
…and then generates code like:
// TypeScript (example)
export interface User {
id: number;
name: string;
status: "active" | "inactive" | "banned";
tags: string[];
userProfile?: UserProfile;
}
export interface UserProfile {
email: string;
age?: number;
}
// Zod schema (example)
import { z } from "zod";
export const userProfileSchema = z.object({
email: z.string().email(),
age: z.number().optional(),
});
export const userSchema = z.object({
id: z.number(),
name: z.string(),
status: z.enum(["active", "inactive", "banned"]),
tags: z.array(z.string()),
userProfile: userProfileSchema.optional(),
});
export type User = z.infer<typeof userSchema>;
(Exact output may differ depending on your options and overrides.)
Clone the repository and install dependencies:
npm install
# or
yarn install
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 in your browser to use TypedLoom locally.
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Icons: Lucide React
- Code Editor: CodeMirror (
@uiw/react-codemirror) - Utilities:
quicktype-core– type inference & codegenjsonrepair– fixing invalid JSON input
Contributions are welcome!
- Found a bug? Open an issue in Issues.
- Want to add a feature or improve the UI?
Fork the repo and submit a Pull Request.
Please include screenshots or small JSON/code examples when reporting issues related to parsing or generation.
This project is open source and available under the MIT License.
