google-labs-code/stitch-sdk — GitHub Repository Preview
AI & Machine Learning ★ 648 TypeScript

google-labs-code/stitch-sdk

by @google-labs-code ·

648 Stars
20 Forks
6 Issues
TypeScript Language

Stitch SDK is a TypeScript library by Google Labs that generates fully rendered UI screens from plain-text prompts and returns both the HTML markup and a screenshot programmatically. Developers describe the interface they want in natural language, and Stitch produces production-ready screen designs for mobile, desktop, tablet, or device-agnostic layouts. The SDK exposes core classes — Stitch, Project, Screen, StitchToolClient, and StitchProxy — that cover the full generation lifecycle from prompt to rendered asset. It supports iterative editing, allowing a generated screen to be refined through follow-up prompts, and can produce design variants for A/B testing or exploration. Stitch integrates with the Vercel AI SDK, making it suitable for agent-driven workflows where a model can call Stitch as a tool to produce UI on demand. Installation is a single npm command, and the API is designed to fit into existing TypeScript projects with minimal setup. It is particularly useful for rapid prototyping, design-to-code pipelines, and AI agents that need to autonomously generate user interfaces without a human designer in the loop.

Author avatar for @google-labs-code
@google-labs-code Project maintainer on GitHub
View Profile
View on GitHub
git clone https://github.com/google-labs-code/stitch-sdk.git

Quick Start Example

typescript
import { Stitch } from '@google/stitch-sdk';

const stitch = new Stitch();

// Generate a UI screen from a text prompt
const project = await stitch.createProject(
  'A dashboard for monitoring server health'
);

const screen = await project.generateScreen({
  prompt: 'Show CPU, memory, and disk metrics with charts',
  deviceType: 'DESKTOP',
});

console.log(screen.html);       // rendered HTML
console.log(screen.screenshot); // base64 screenshot

Tags

#ai#ui-generation#sdk#typescript#google#design-automation

Related Projects