The Open Standard for Generative UI
blog: add FAQ section and FAQPage JSON-LD to Intelligent UI post (#1365)
devin-ai-integration[bot]36c3410d60dc
diff --git a/docs/app/(home)/sections/FaqSection/FaqSection.module.css b/docs/app/(home)/sections/FaqSection/FaqSection.module.cssindex 30bddf6b6..6bd8962cf 100644--- a/docs/app/(home)/sections/FaqSection/FaqSection.module.css+++ b/docs/app/(home)/sections/FaqSection/FaqSection.module.css@@ -1,10 +1,13 @@/* Colour through tokens so the one set of rules serves both themes. */-.section {+.section,+.list {--faq-text: var(--openui-text-neutral-primary);--faq-muted: var(--openui-text-neutral-secondary);--faq-surface: #fff;--faq-border: rgba(10, 10, 10, 0.08);+}+.section {display: grid;grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);align-items: start;@@ -20,7 +23,8 @@color: var(--faq-text);}-[data-theme="dark"] .section {+[data-theme="dark"] .section,+[data-theme="dark"] .list {--faq-surface: rgba(255, 255, 255, 0.042);--faq-border: rgba(255, 255, 255, 0.09);}diff --git a/docs/app/(home)/sections/FaqSection/FaqSection.tsx b/docs/app/(home)/sections/FaqSection/FaqSection.tsxindex aa818e766..e85db7aba 100644--- a/docs/app/(home)/sections/FaqSection/FaqSection.tsx+++ b/docs/app/(home)/sections/FaqSection/FaqSection.tsx@@ -123,30 +123,41 @@ export function FaqSection({</p></div>- <div className={styles.list}>- {faqs.map(({ question, answer }, index) => (- <details- className={styles.item}- key={question}- name={`${titleId}-accordion`}- open={firstOpen && index === 0}- >- <summary className={styles.question}>- <span className={styles.questionText}>{question}</span>- {/* Two bars making a plus; the upright one collapses when open,- leaving a minus. */}- <span className={styles.marker} aria-hidden="true" />- </summary>- <div className={styles.answer}>- {answer.map((paragraph) => (- <p className={styles.paragraph} key={paragraph}>- {paragraph}- </p>- ))}- </div>- </details>- ))}- </div>+ <FaqList faqs={faqs} name={`${titleId}-accordion`} firstOpen={firstOpen} /></section>);}++/* The questions on their own, for pages that supply their own heading (blog+ * posts). Items sharing `name` open one at a time. */+export function FaqList({+ faqs,+ name,+ firstOpen = false,+}: {+ faqs: { question: string; answer: ReactNode[] }[];+ name: string;+ firstOpen?: boolean;+}) {+ return (+ <div className={styles.list}>+ {faqs.map(({ question, answer }, index) => (+ <details className={styles.item} key={question} name={name} open={firstOpen && index === 0}>+ <summary className={styles.question}>+ <span className={styles.questionText}>{question}</span>+ {/* Two bars making a plus; the upright one collapses when open,+ leaving a minus. */}+ <span className={styles.marker} aria-hidden="true" />+ </summary>+ <div className={styles.answer}>+ {answer.map((paragraph, paragraphIndex) => (+ <p className={styles.paragraph} key={paragraphIndex}>+ {paragraph}+ </p>+ ))}+ </div>+ </details>+ ))}+ </div>+ );+}diff --git a/docs/app/blog/[slug]/page.tsx b/docs/app/blog/[slug]/page.tsxindex 06e4bc49a..a0e5808bf 100644--- a/docs/app/blog/[slug]/page.tsx+++ b/docs/app/blog/[slug]/page.tsx@@ -8,6 +8,7 @@ import { TOCProvider, TOCScrollArea } from "fumadocs-ui/components/toc";import { TOCItem, TOCItems } from "fumadocs-ui/components/toc/default";import type { Metadata } from "next";import { notFound } from "next/navigation";+import { BlogFaq } from "../components/BlogFaq";export default async function BlogPostPage(props: { params: Promise<{ slug: string }> }) {const params = await props.params;@@ -15,9 +16,13 @@ export default async function BlogPostPage(props: { params: Promise<{ slug: striif (!page) notFound();const Mdx = page.data.body;+ const { faq } = page.data;+ const toc = faq?.length+ ? [...page.data.toc, { title: "FAQ", url: "#faq", depth: 2 }]+ : page.data.toc;return (- <TOCProvider toc={page.data.toc}>+ <TOCProvider toc={toc}>{/* Blend from the menu bar's surface color into a gray band, then back into thefooter's surface — matching the home content band (light: foreground->background->foreground;dark: black -> neutral-950 -> black, so the edges meet the black menu + footer). */}@@ -28,7 +33,7 @@ export default async function BlogPostPage(props: { params: Promise<{ slug: stri<p className="mb-3 text-sm font-medium text-fd-foreground">On this page</p><TOCScrollArea className="max-h-[calc(100vh-8rem)]"><TOCItems>- {page.data.toc.map((item) => (+ {toc.map((item) => (<TOCItem key={item.url} item={item} />))}</TOCItems>@@ -50,6 +55,7 @@ export default async function BlogPostPage(props: { params: Promise<{ slug: stri</div><article className="prose mt-8 min-w-0"><Mdx components={getMDXComponents()} />+ {faq?.length ? <BlogFaq faqs={faq} url={page.url} /> : null}</article><div className="mt-12 border-t border-[color:var(--home-hairline)] pt-8"><GitHubButton variant="desktopGlow" />diff --git a/docs/app/blog/components/BlogFaq.tsx b/docs/app/blog/components/BlogFaq.tsxnew file mode 100644index 000000000..0830c8b0a--- /dev/null+++ b/docs/app/blog/components/BlogFaq.tsx@@ -0,0 +1,74 @@+import { FaqList } from "@/app/(home)/sections/FaqSection/FaqSection";+import { BASE_URL } from "@/lib/source";+import Link from "next/link";+import type { ReactNode } from "react";++export type BlogFaqItem = {+ question: string;+ /* One entry per paragraph. */+ answer: string[];+};++/* Inline code and [text](href) links: all an FAQ answer needs. */+const INLINE = /`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)\)/g;++function renderInline(text: string): ReactNode {+ const nodes: ReactNode[] = [];+ let last = 0;+ for (const match of text.matchAll(INLINE)) {+ const [whole, code, label, href] = match;+ if (match.index > last) nodes.push(text.slice(last, match.index));+ nodes.push(+ code !== undefined ? (+ <code key={match.index}>{code}</code>+ ) : (+ <Link key={match.index} href={href}>+ {label}+ </Link>+ ),+ );+ last = match.index + whole.length;+ }+ if (last < text.length) nodes.push(text.slice(last));+ return nodes;+}++/* The same words without the markup, for the structured data. */+function toPlainText(text: string): string {+ return text.replace(INLINE, (_whole, code?: string, label?: string) => code ?? label ?? "");+}++/* Closing FAQ for a blog post, from the post's `faq` frontmatter. Renders the+ * questions and the matching FAQPage JSON-LD from the one array, so the two+ * can't drift apart. */+export function BlogFaq({ faqs, url }: { faqs: BlogFaqItem[]; url: string }) {+ const structuredData = {+ "@context": "https://schema.org",+ "@type": "FAQPage",+ "@id": `${BASE_URL}${url}#faq`,+ mainEntity: faqs.map(({ question, answer }) => ({+ "@type": "Question",+ name: question,+ acceptedAnswer: { "@type": "Answer", text: answer.map(toPlainText).join(" ") },+ })),+ };++ return (+ <>+ <h2 id="faq">FAQ</h2>+ <FaqList+ faqs={faqs.map(({ question, answer }) => ({+ question,+ answer: answer.map(renderInline),+ }))}+ name="blog-faq"+ />+ <script+ type="application/ld+json"+ dangerouslySetInnerHTML={{+ __html: JSON.stringify(structuredData).replaceAll("<", "\\u003c"),+ }}+ />+ </>+ );+}diff --git a/docs/content/blog/how-chatgpt-intelligent-ui-works.mdx b/docs/content/blog/how-chatgpt-intelligent-ui-works.mdxindex 552d9235e..f89375914 100644--- a/docs/content/blog/how-chatgpt-intelligent-ui-works.mdx+++ b/docs/content/blog/how-chatgpt-intelligent-ui-works.mdx@@ -4,6 +4,17 @@ seoTitle: "How ChatGPT's Intelligent UI works (and how to build it in your app)"description: "ChatGPT's Intelligent UI works by having the model write a markup language called DIL, which the server compiles to JavaScript and a sandboxed client runtime renders as native components. We reverse-engineered each layer, from the inference format to streaming, data and actions."author: Thesys Engineering Teamdate: 2026-10-08+faq:+ - question: "What is DIL in ChatGPT?"+ answer:+ - "DIL is the language GPT-6 writes when ChatGPT answers with Intelligent UI. It combines Markdown for prose, JSX-like tags for components from ChatGPT's catalog (such as `<slider>` and `<box>`), and JavaScript for state and logic. ChatGPT's server compiles DIL into a JavaScript program and a JSON document before anything runs in the browser."+ - question: "Where does ChatGPT Intelligent UI fit on the generative UI spectrum?"+ answer:+ - "Mostly Declarative, with an Open-Ended escape hatch. In the [State of Generative UI report](/blog/state-of-generative-ui-report#generation-static-vs-declarative-vs-open-ended), generative UI ranges from Static, where the agent selects a pre-built component, through Declarative, where it composes a spec from your catalog, to Open-Ended, where the model writes raw HTML."+ - "Most ChatGPT responses are Declarative: GPT-6 writes DIL that composes components from ChatGPT's catalog, and the compiler validates properties against it. `AppBlock` is the Open-Ended part. For things the catalog can't draw, such as a Web Audio drum machine, the model writes a self-contained HTML app that runs in a sandboxed iframe. That is the [combined pattern](/blog/state-of-generative-ui-report#combining-styles-an-open-ended-component-inside-a-declarative-catalog) the report describes: one Open-Ended component inside a Declarative catalog."+ - question: "How can I build something like ChatGPT Intelligent UI in my own app?"+ answer:+ - "You need the same pieces ChatGPT uses: a compact language the model can stream, a component catalog for it to choose from, a renderer that draws only known components, and local state so interactions don't need a model call. [OpenUI](/docs) is an open-source, MIT-licensed framework built on that pattern."---import { ArchitectureDiagram } from "./components/architecture-diagram";diff --git a/docs/source.config.ts b/docs/source.config.tsindex fde082104..0cb2de6c4 100644--- a/docs/source.config.ts+++ b/docs/source.config.ts@@ -37,6 +37,9 @@ export const blogPosts = defineCollections({author: z.string(),date: z.string().date().or(z.date()),featured: z.boolean().optional(),+ // Rendered after the post and emitted as FAQPage JSON-LD. Answers are+ // paragraphs that may use inline code and [links](/path).+ faq: z.array(z.object({ question: z.string(), answer: z.array(z.string()).min(1) })).optional(),/** Social preview image in `public/`, used instead of the cropped cover. */ogImage: z.string().optional(),}),