Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
867ea90
Implement React Email Chat example with OpenAI integration
i-subham23 Mar 20, 2026
23d5a59
Enhance React Email Chat example with new components and functionality
i-subham23 Mar 21, 2026
177e930
Remove React Email Chat example and related configurations
i-subham23 Mar 21, 2026
cc3eecd
Refactor and remove React Email Chat package
i-subham23 Mar 21, 2026
cfd75fc
Enhance responsiveness in ChatPage and ComposePage components
i-subham23 Mar 21, 2026
9896cf3
Enhance ChatPage component for improved mobile responsiveness
i-subham23 Mar 21, 2026
bba863c
Add React Email Chat package with initial setup and components
i-subham23 Mar 21, 2026
07df1b2
Implement React Email Chat example with comprehensive features
i-subham23 Mar 22, 2026
bf86f9f
Add TypeScript definitions and update prompt generation in React Emai…
i-subham23 Mar 22, 2026
afe0397
Refactor React Email Chat example by removing unused components and u…
i-subham23 Mar 22, 2026
5ad25b6
Refactor EmailApp component in React Email Chat example for improved …
i-subham23 Mar 23, 2026
61645b3
Refactor imports in library.ts for improved organization
i-subham23 Mar 23, 2026
c872a7f
Update dependencies and clean up React Email Chat example
i-subham23 Mar 23, 2026
81aba7f
Refactor React Email Chat components and update dependencies
i-subham23 Mar 23, 2026
85f4fd8
Enhance React Email Chat functionality and update components
i-subham23 Mar 23, 2026
7ec3c64
Refactor React Email Chat to utilize new email library and clean up code
i-subham23 Mar 23, 2026
9331da7
Add React Email example with new components and features
i-subham23 Mar 23, 2026
8a2f5bf
Update pnpm-lock.yaml to reflect dependency changes and version updates
i-subham23 Mar 23, 2026
57be8b6
Merge remote-tracking branch 'origin' into sd/example/react-email-chat
i-subham23 Mar 23, 2026
016d4e6
Add lucide-react dependency and refactor email components
i-subham23 Mar 24, 2026
c4c9ed0
Remove deprecated render-email.tsx file and update EmailEditor to use…
i-subham23 Mar 24, 2026
fb17209
Refactor email components and update imports for consistency
i-subham23 Mar 24, 2026
36d56b1
Update React Email example documentation and structure
i-subham23 Mar 24, 2026
8115100
Add tsx dependency to React Email example
i-subham23 Mar 24, 2026
1585fcc
Refactor theme handling and streamline email components
i-subham23 Mar 24, 2026
e9dae43
Refactor email component organization and structure
i-subham23 Mar 24, 2026
9e8647f
Enhance React Email package and workflow configuration
i-subham23 Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/react-email-chat/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=sk-your-api-key-here
47 changes: 47 additions & 0 deletions examples/react-email-chat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# React Email Chat

AI-powered email generator built with [OpenUI](https://github.com/anthropics/openui) and [React Email](https://react.email).

Describe an email in natural language, and the AI generates a live email preview with exportable HTML. Iterate on the design through conversation.

## Features

- **Live email preview** — renders in an iframe for accurate email client representation
- **Copy HTML** — one-click export of email-client-compatible HTML
- **Iterative design** — follow-up suggestions to refine the email
- **Multiple email types** — welcome emails, newsletters, order confirmations, password resets, and more

## Getting Started

1. Copy `.env.example` to `.env.local` and add your OpenAI API key:

```bash
cp .env.example .env.local
```

2. Install dependencies from the monorepo root:

```bash
pnpm install
```

3. Start the development server:

```bash
pnpm --filter react-email-chat dev
```

## Email Components

| Component | Description |
|-----------|-------------|
| `EmailTemplate` | Root wrapper with subject, preview text, and Copy HTML |
| `EmailHeading` | Heading (h1-h6) |
| `EmailText` | Body text paragraph |
| `EmailButton` | Call-to-action button with link |
| `EmailImage` | Image with alt text |
| `EmailDivider` | Horizontal divider |
| `EmailLink` | Inline hyperlink |
| `EmailSection` | Content grouping |
| `EmailColumns` | Multi-column row layout |
| `EmailColumn` | Single column in a row |
22 changes: 22 additions & 0 deletions examples/react-email-chat/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
globalIgnores([
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
{
files: ["src/openui/**/*.{ts,tsx}"],
rules: {
"react-hooks/rules-of-hooks": "off",
},
},
]);

export default eslintConfig;
6 changes: 6 additions & 0 deletions examples/react-email-chat/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
11 changes: 11 additions & 0 deletions examples/react-email-chat/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
transpilePackages: [
"@openuidev/react-headless",
"@openuidev/react-lang",
"@openuidev/react-email",
],
};

export default nextConfig;
36 changes: 36 additions & 0 deletions examples/react-email-chat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "react-email-chat-example",
"version": "0.1.0",
"private": true,
"scripts": {
"generate:prompt": "pnpm --filter @openuidev/cli build && pnpm exec openui generate src/lib/library.ts --out src/generated/system-prompt.txt",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
},
"dependencies": {
"@openuidev/cli": "workspace:*",
"@openuidev/react-email": "workspace:*",
"@openuidev/react-headless": "workspace:*",
"@openuidev/react-lang": "workspace:*",
"@react-email/components": "^0.0.41",
"@react-email/render": "^1.0.6",
"lucide-react": "^0.575.0",
"next": "16.1.6",
"openai": "^6.22.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"zod": "^4.3.6"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.1.6",
"tailwindcss": "^4",
"typescript": "^5"
}
}
7 changes: 7 additions & 0 deletions examples/react-email-chat/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};

export default config;
Loading