Skip to content

feat(examples): add Material UI chat example (#392)#587

Open
Shinyaigeek wants to merge 1 commit into
thesysdev:mainfrom
Shinyaigeek:example/material-ui-chat
Open

feat(examples): add Material UI chat example (#392)#587
Shinyaigeek wants to merge 1 commit into
thesysdev:mainfrom
Shinyaigeek:example/material-ui-chat

Conversation

@Shinyaigeek
Copy link
Copy Markdown
Contributor

Closes #392.

Adds examples/material-ui-chat — a generative-UI chat app that maps OpenUI Lang onto a Material UI component library, as the MUI counterpart to examples/shadcn-chat. It shows how to integrate OpenUI with an existing design system (MUI components + theme), including light/dark mode.

What's included

  • Component library (src/lib/mui-genui/) wrapping MUI primitives, covering a representative subset: CardHeader, TextContent, Heading, Alert, List, Separator, Progress, Table, BarChart/LineChart/PieChart (via @mui/x-charts), Form/FormControl/Input/Select/SwitchGroup, Button/Buttons, Tabs, Accordion, FollowUpBlock (~22 components).
  • OpenAI streaming chat route (src/app/api/chat/route.ts) using runTools + SSE, mirroring shadcn-chat.
  • MUI theming via ThemeProvider + CssBaseline with a system-preference + manual light/dark toggle.
  • Prompt generation through the OpenUI CLI (openui generate src/library.ts).

Verification

  • pnpm install
  • pnpm generate:prompt ✅ (writes src/generated/system-prompt.txt)
  • tsc --noEmit
  • next build

🤖 Generated with Claude Code

Add `examples/material-ui-chat`, a generative-UI chat app that maps OpenUI
Lang onto a Material UI component library — cards, tables, forms, tabs,
accordion, alert, list, and charts (via `@mui/x-charts`) — with MUI
`ThemeProvider`/`CssBaseline` theming, a system + manual light/dark toggle,
and an OpenAI streaming chat route. Mirrors the structure of the
`shadcn-chat` example; the system prompt is generated from the library via
the OpenUI CLI (`openui generate src/library.ts`).

Closes thesysdev#392.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Material UI example app

1 participant