Skip to content

The Open Standard for Generative UI

Update FeaturesSection and StepsSection components of openui homepage (#257)

Aditya-thesys409f0c4edad8
diff --git a/docs/app/(home)/components/BuildChatSection.tsx b/docs/app/(home)/components/BuildChatSection.tsx
index fed6f55d5..ebdb185e6 100644
--- a/docs/app/(home)/components/BuildChatSection.tsx
+++ b/docs/app/(home)/components/BuildChatSection.tsx
@@ -1,5 +1,7 @@
"use client";
+import { useEffect, useRef, useState } from "react";
+
const dashboardImg = "/images/home/d67b5e94653944c1d0d4998c6b169c37f98060ad.png";
import { CopyIcon } from "./shared";
@@ -33,16 +35,55 @@ function SectionDescription() {
}
function CtaButton() {
- const handleClick = () => {
- navigator.clipboard.writeText("npx create openui-app chat");
+ const [copied, setCopied] = useState(false);
+ const resetTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+
+ useEffect(() => {
+ return () => {
+ if (resetTimeoutRef.current) {
+ clearTimeout(resetTimeoutRef.current);
+ }
+ };
+ }, []);
+
+ const handleClick = async () => {
+ if (copied) return;
+
+ try {
+ await navigator.clipboard.writeText("npx create openui-app chat");
+ setCopied(true);
+ resetTimeoutRef.current = setTimeout(() => {
+ setCopied(false);
+ }, 3000);
+ } catch {
+ setCopied(false);
+ }
};
+
return (
- <div
- className="flex items-center justify-center lg:justify-start mt-6 lg:mt-0 pt-4"
- onClick={handleClick}
- >
- <button className="bg-black rounded-full h-12 px-5 flex items-center gap-2.5 cursor-pointer relative transition-all duration-200 hover:scale-105 w-full max-w-[280px] lg:max-w-none lg:w-auto justify-center lg:justify-start">
- <CopyIcon />
+ <div className="flex items-center justify-center lg:justify-start mt-6 lg:mt-0 pt-4">
+ <button
+ onClick={handleClick}
+ className="bg-black rounded-full h-12 px-5 flex items-center gap-2.5 cursor-pointer relative transition-all duration-200 hover:scale-105 w-full max-w-[280px] lg:max-w-none lg:w-auto justify-center lg:justify-start"
+ >
+ <span className="relative size-4 flex items-center justify-center">
+ <span className={`absolute transition-all duration-300 ${copied ? "opacity-0 scale-50" : "opacity-100 scale-100"}`}>
+ <CopyIcon />
+ </span>
+ <svg
+ className={`size-4 absolute transition-all duration-300 ${copied ? "opacity-100 scale-100" : "opacity-0 scale-50"}`}
+ fill="none"
+ viewBox="0 0 14 14"
+ >
+ <path
+ d="M11.6667 3.5L5.25 9.91667L2.33334 7"
+ stroke="white"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </svg>
+ </span>
<span className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-white relative whitespace-nowrap">
npx create openui-app chat
</span>
diff --git a/docs/app/(home)/components/CompatibilitySection.tsx b/docs/app/(home)/components/CompatibilitySection.tsx
index 8520ff705..7685a73c8 100644
--- a/docs/app/(home)/components/CompatibilitySection.tsx
+++ b/docs/app/(home)/components/CompatibilitySection.tsx
@@ -22,7 +22,6 @@ const LLMS: CompatibilityItem[] = [
{ name: "Anthropic", slug: "anthropic", iconColor: "ffffff", badgeBg: "bg-[#D4A574]" },
{ name: "Gemini", slug: "googlegemini", iconColor: "000000", badgeBg: "bg-white", border: true },
{ name: "Mistral", slug: "mistralai", iconColor: "ffffff", badgeBg: "bg-[#FF7000]" },
- { name: "Ollama", slug: "ollama", iconColor: "000000", badgeBg: "bg-white", border: true },
];
const FRAMEWORKS: CompatibilityItem[] = [
diff --git a/docs/app/(home)/components/FeaturesSection.tsx b/docs/app/(home)/components/FeaturesSection.tsx
index f2f754422..76c245a1d 100644
--- a/docs/app/(home)/components/FeaturesSection.tsx
+++ b/docs/app/(home)/components/FeaturesSection.tsx
@@ -19,12 +19,12 @@ interface Feature {
const FEATURES: Feature[] = [
{
title: "Performance Optimized",
- description: "upto 3x faster rendering than json-render",
+ description: "2.1x faster rendering than json-render",
iconPath: svgPaths.p7658f00,
},
{
title: "Token efficient",
- description: "upto 74% lesser tokens than json-render",
+ description: "52% lesser tokens than json-render",
iconPath: svgPaths.p2a8ddd80,
},
{
@@ -212,7 +212,7 @@ export function FeaturesSection() {
</div>
{/* CTA button */}
- <Link href="/docs/openui-lang/benchmark">
+ <Link href="/docs/openui-lang/benchmarks">
<div className="flex justify-center mt-10 lg:mt-20">
<motion.button
className="bg-white text-black rounded-full h-12 px-4 font-['Inter',sans-serif] font-medium text-base lg:text-lg leading-6 border-[1.25px] border-black/8 w-full max-w-[280px] lg:max-w-none lg:w-auto transition-all duration-200 hover:scale-105 cursor-pointer"
diff --git a/docs/app/(home)/components/Footer.tsx b/docs/app/(home)/components/Footer.tsx
index 92c3c9b27..8417f6f0b 100644
--- a/docs/app/(home)/components/Footer.tsx
+++ b/docs/app/(home)/components/Footer.tsx
@@ -1,7 +1,5 @@
'use client';
-import { useState } from "react";
-import { ArrowRight, Check } from "lucide-react";
import svgPaths from "@/imports/svg-urruvoh2be";
import mascotSvgPaths from "@/imports/svg-xeurqn3j1r";
@@ -112,50 +110,6 @@ function ThesysLogo() {
);
}
-function NewsletterInput() {
- const [email, setEmail] = useState("");
- const [submitted, setSubmitted] = useState(false);
-
- const handleSubmit = () => {
- if (!email || submitted) return;
- setSubmitted(true);
- setTimeout(() => {
- setSubmitted(false);
- setEmail("");
- }, 3000);
- };
-
- return (
- <div className="bg-black/6 h-10 rounded-full w-[282px] lg:w-[240px] relative border border-black/10">
- <div className="flex items-center gap-1 pl-3 pr-1.5 py-3 h-full">
- <input
- type="email"
- value={email}
- onChange={(e) => setEmail(e.target.value)}
- onKeyDown={(e) => e.key === "Enter" && handleSubmit()}
- placeholder="[email protected]"
- className="flex-1 bg-transparent outline-none font-['Inter',sans-serif] text-[15px] text-black leading-[1.5] placeholder:text-black/40 min-w-0"
- />
- <button
- onClick={handleSubmit}
- className="bg-black size-7 rounded-full flex items-center justify-center shrink-0 transition-colors duration-300 cursor-pointer"
- >
- <div className="relative size-4 flex items-center justify-center">
- <ArrowRight
- className={`size-4 text-white absolute transition-all duration-300 ${submitted ? "opacity-0 scale-50" : "opacity-100 scale-100"}`}
- strokeWidth={2}
- />
- <Check
- className={`size-4 text-white absolute transition-all duration-300 ${submitted ? "opacity-100 scale-100" : "opacity-0 scale-50"}`}
- strokeWidth={2.5}
- />
- </div>
- </button>
- </div>
- </div>
- );
-}
-
// ---------------------------------------------------------------------------
// Main component
// ---------------------------------------------------------------------------
@@ -188,51 +142,40 @@ export function Footer() {
<div className="bg-white px-5 lg:px-8 pt-[60px] pb-4">
<div className="max-w-[1200px] mx-auto">
{/* Desktop */}
- <div className="hidden lg:flex items-start justify-between">
- <div className="flex flex-col gap-3 w-[300px]">
- <p className="font-['Inter',sans-serif] font-medium text-[15px] text-black/40 leading-[1.2]">
- Keep in touch
- </p>
- <SocialIcons />
- </div>
-
+ <div className="hidden lg:flex flex-col items-center">
<ThesysLogo />
-
- <div className="flex flex-col gap-3 items-end w-[300px]">
- <p className="font-['Inter',sans-serif] font-medium text-[15px] text-black/40 leading-[1.2] text-right">
- Subscribe to newsletter
- </p>
- <NewsletterInput />
- </div>
</div>
-
{/* Mobile */}
- <div className="lg:hidden flex flex-col items-center gap-10">
+ <div className="lg:hidden flex w-full flex-col items-center">
<ThesysLogo />
- <div className="flex flex-col items-center gap-6 w-full">
- <div className="flex flex-col items-center gap-3 w-full">
- <p className="font-['Inter',sans-serif] font-medium text-[15px] text-black/40 leading-[1.2]">
- Subscribe to newsletter
- </p>
- <NewsletterInput />
- </div>
- <SocialIcons />
- </div>
</div>
{/* Bottom bar */}
- <div className="mt-[60px] border-t border-black/4 py-4">
- <div className="flex flex-col lg:flex-row items-center justify-between gap-2">
- <p className="font-['Inter',sans-serif] text-xs lg:text-[15px] text-black/40 leading-[1.5] text-center lg:text-left">
+ <div className="mt-10 lg:mt-[60px] border-t border-black/4 py-4 lg:py-4">
+ <div className="hidden lg:flex items-center justify-between gap-2">
+ <p className="font-['Inter',sans-serif] text-[15px] text-black/40 leading-[1.5] text-left">
355 Bryant St, San Francisco, CA 94107
</p>
- <p className="font-['Inter',sans-serif] text-xs lg:text-[15px] text-black/40 leading-[1.5] text-center lg:text-right">
- 2025 Thesys Inc. All Rights Reserved
+ <SocialIcons />
+ <p className="font-['Inter',sans-serif] text-[15px] text-black/40 leading-[1.5] text-right">
+ © {new Date().getFullYear()} Thesys Inc. All Rights Reserved
</p>
</div>
+
+ <div className="lg:hidden flex flex-col items-center justify-start pt-10 pb-5">
+ <SocialIcons />
+ <div className="mt-10 text-center">
+ <p className="font-['Inter',sans-serif] text-xs text-black/40 leading-[1.5]">
+ © {new Date().getFullYear()} Thesys Inc. All Rights Reserved
+ </p>
+ <p className="font-['Inter',sans-serif] text-xs text-black/40 leading-[1.5]">
+ 355 Bryant St, San Francisco, CA 94107
+ </p>
+ </div>
+ </div>
</div>
</div>
</div>
</footer>
);
-}
\ No newline at end of file
+}
diff --git a/docs/app/(home)/components/HeroSection.tsx b/docs/app/(home)/components/HeroSection.tsx
index 1764f29e3..ff7f1c8e4 100644
--- a/docs/app/(home)/components/HeroSection.tsx
+++ b/docs/app/(home)/components/HeroSection.tsx
@@ -5,7 +5,7 @@ import { useRef, useState, useEffect, lazy, Suspense } from "react";
import svgHeroPaths from "@/imports/svg-a5kdrdeeao";
import svgMascotPaths from "@/imports/svg-148i9mcxjn";
import HeroPreviewFrame from "@/imports/Frame2147239423";
-import { BUTTON_SHADOW, CopyIcon } from "./shared";
+import { CopyIcon } from "./shared";
const LazyMobileActionFigure = lazy(
() => import("@/imports/MobileActionFigure")
@@ -22,6 +22,7 @@ const DESKTOP = { duration: 0.7, lines: 0, title: 0.5, subtitle: 1.0, cta: 1.5,
/** Mobile: snappier with tighter stagger */
const MOBILE = { duration: 0.5, mascot: 0, title: 0.25, subtitle: 0.5, cta: 0.75 } as const;
+const HERO_BUTTON_SHADOW = "0 8px 16px -4px rgba(22, 34, 51, 0.08)";
// ---------------------------------------------------------------------------
// Animation helpers
@@ -49,41 +50,122 @@ const mobileFadeUp = (delay: number) => ({
// CTAs
const primaryCTA = "npm install @openuidev/lang-react @openuidev/react-ui";
-const secondaryCTA = "Playground";
+const secondaryCTA = "Try Playground";
+const COPIED_FEEDBACK_MS = 3000;
// ---------------------------------------------------------------------------
// Buttons
// ---------------------------------------------------------------------------
-function PrimaryButton({ className = "" }: { className?: string }) {
+function NpmButton({ className = "" }: { className?: string }) {
+ const [copied, setCopied] = useState(false);
+ const copiedTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+
+ useEffect(() => {
+ return () => {
+ if (copiedTimeoutRef.current) {
+ clearTimeout(copiedTimeoutRef.current);
+ }
+ };
+ }, []);
+
+ const onCopy = async () => {
+ try {
+ await navigator.clipboard.writeText(primaryCTA);
+ setCopied(true);
+ if (copiedTimeoutRef.current) {
+ clearTimeout(copiedTimeoutRef.current);
+ }
+ copiedTimeoutRef.current = setTimeout(() => {
+ setCopied(false);
+ }, COPIED_FEEDBACK_MS);
+ } catch {
+ setCopied(false);
+ }
+ };
+
+ return (
+ <>
+ <button
+ className={`flex h-12 items-center justify-center gap-2.5 pl-5 pr-2 shrink-0 cursor-pointer rounded-[999px] border-[1.25px] border-black/8 bg-white transition-all duration-200 hover:scale-105 ${className}`}
+ style={{ boxShadow: HERO_BUTTON_SHADOW }}
+ onClick={onCopy}
+ >
+ <span className="hidden lg:inline font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-black whitespace-nowrap">
+ {primaryCTA}
+ </span>
+ <span className="lg:hidden relative flex-1 min-w-0 overflow-hidden">
+ <span className="npmTicker flex w-max items-center">
+ <span className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-black whitespace-nowrap pr-8">
+ {primaryCTA}
+ </span>
+ <span
+ aria-hidden="true"
+ className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-black whitespace-nowrap pr-8"
+ >
+ {primaryCTA}
+ </span>
+ </span>
+ </span>
+ <span className="size-8 rounded-full bg-black flex items-center justify-center shrink-0">
+ <span className="relative size-4 flex items-center justify-center">
+ <span className={`absolute transition-all duration-300 ${copied ? "opacity-0 scale-50" : "opacity-100 scale-100"}`}>
+ <CopyIcon color="white" />
+ </span>
+ <svg
+ className={`size-4 absolute transition-all duration-300 ${copied ? "opacity-100 scale-100" : "opacity-0 scale-50"}`}
+ fill="none"
+ viewBox="0 0 14 14"
+ >
+ <path
+ d="M11.6667 3.5L5.25 9.91667L2.33334 7"
+ stroke="white"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </svg>
+ </span>
+ </span>
+ </button>
+ <style jsx>{`
+ .npmTicker {
+ animation: npmTickerScroll 10s linear infinite;
+ }
+ @keyframes npmTickerScroll {
+ 0% {
+ transform: translateX(0);
+ }
+ 100% {
+ transform: translateX(-50%);
+ }
+ }
+ `}</style>
+ </>
+ );
+}
+
+function DesktopPlaygroundButton({ className = "" }: { className?: string }) {
return (
- <button
- className={`bg-black flex gap-2.5 h-12 items-center justify-center px-5 rounded-full shrink-0 cursor-pointer transition-all duration-200 hover:scale-105 hover:bg-black/85 active:bg-black/75 ${className}`}
- onClick={() => {
- navigator.clipboard.writeText(primaryCTA);
- }}
+ <a
+ href="/playground"
+ className={`flex h-12 items-center justify-center gap-2 rounded-[999px] px-5 font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-black cursor-pointer transition-all duration-200 hover:scale-105 ${className}`}
>
- <CopyIcon />
- <span className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-white whitespace-nowrap">
- {primaryCTA}
- </span>
- </button>
+ <span>{secondaryCTA}</span>
+ <span aria-hidden="true">→</span>
+ </a>
);
}
-function SecondaryButton({ className = "" }: { className?: string }) {
+function MobilePlaygroundButton({ className = "" }: { className?: string }) {
return (
<a href="/playground">
<button
- className={`bg-white flex gap-2.5 h-12 items-center justify-center px-4 rounded-full shrink-0 cursor-pointer relative transition-all duration-200 hover:scale-105 ${className}`}
+ className={`flex h-12 items-center justify-center gap-2 rounded-[100px] bg-black px-5 shrink-0 cursor-pointer transition-all duration-200 hover:bg-black/85 ${className}`}
>
- <div
- aria-hidden="true"
- className="absolute inset-0 pointer-events-none rounded-full border-[1.25px] border-black/8"
- style={{ boxShadow: BUTTON_SHADOW }}
- />
- <span className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-black relative whitespace-nowrap">
+ <span className="font-['Inter_Display',sans-serif] font-medium text-[18px] leading-6 text-white whitespace-nowrap">
{secondaryCTA}
</span>
+ <span aria-hidden="true" className="text-white text-[20px] leading-none">→</span>
</button>
</a>
);
@@ -192,7 +274,11 @@ function DesktopHero() {
{...fadeUp(DESKTOP.subtitle)}
>
<svg className="w-full h-full" fill="none" viewBox="0 0 1600 376">
- <path d={svgHeroPaths.p38a6ed80} fill="black" fillOpacity="0.4" />
+ <g transform="translate(180 0)">
+ <g transform="translate(880 75) scale(1.5) translate(-980 -108)">
+ <path d={svgHeroPaths.p38a6ed80} fill="black" fillOpacity="0.4" />
+ </g>
+ </g>
</svg>
</motion.div>
@@ -202,12 +288,14 @@ function DesktopHero() {
{/* CTA buttons */}
<motion.div
- className="absolute flex gap-1.5 will-change-[transform,opacity]"
- style={{ left: "51.125%", top: "71.19%" }}
+ className="absolute will-change-[transform,opacity]"
+ style={{ left: "50%", top: "71.19%" }}
{...fadeUp(DESKTOP.cta)}
>
- <PrimaryButton />
- <SecondaryButton />
+ <div className="relative -translate-x-1/2 flex flex-col items-center gap-2 pt-14">
+ <NpmButton />
+ <DesktopPlaygroundButton />
+ </div>
</motion.div>
</div>
</div>
@@ -261,8 +349,8 @@ function MobileHero() {
className="relative flex flex-col items-center gap-3 px-10 pt-5 pb-20"
{...mobileFadeUp(MOBILE.cta)}
>
- <SecondaryButton className="w-full max-w-[280px]" />
- <PrimaryButton className="w-full max-w-[280px]" />
+ <MobilePlaygroundButton className="w-[320px] max-w-full" />
+ <NpmButton className="w-[320px] max-w-full" />
</motion.div>
{/* Full-width hero illustration */}
diff --git a/docs/app/(home)/components/Navbar.tsx b/docs/app/(home)/components/Navbar.tsx
index 5aee6a2d5..7031bc4f2 100644
--- a/docs/app/(home)/components/Navbar.tsx
+++ b/docs/app/(home)/components/Navbar.tsx
@@ -1,6 +1,6 @@
'use client';
-import { useState, useEffect, useRef, useCallback } from "react";
+import { useState, useEffect, useCallback } from "react";
import { motion, AnimatePresence } from "motion/react";
import svgPaths from "@/imports/svg-urruvoh2be";
import { BUTTON_SHADOW } from "./shared";
diff --git a/docs/app/(home)/components/StepsSection.tsx b/docs/app/(home)/components/StepsSection.tsx
index 3def02376..6bd111314 100644
--- a/docs/app/(home)/components/StepsSection.tsx
+++ b/docs/app/(home)/components/StepsSection.tsx
@@ -15,33 +15,34 @@ interface Step {
number: number;
title: string;
description: string;
+ detailsTitle?: string;
details: string[];
}
const STEPS: Step[] = [
{
number: 1,
- title: "You register components",
- description: "Instead of markdown, the LLM\nreturns structured UI spec.",
- details: ["You declare:", "What components exist", "What props they accept", "What structure is valid"],
+ title: "You define your library",
+ description: "Register components with defineComponent and createLibrary.",
+ details: [],
},
{
number: 2,
- title: "OpenUI generates schema",
- description: "OpenUI converts your component registry into a structured schema.",
- details: ["Model understands:", "Available components", "Required props", "Valid types"],
+ title: "Generate and send system prompt",
+ description: "Generate a system prompt from your library with OpenUI SDK and send it to the LLM.",
+ details: [],
},
{
number: 3,
- title: "LLMs responds in OpenUI lang",
- description: "Instead of markdown, the LLM\nreturns structured UI spec.",
- details: ["The response contains:", "Structured UI composition", "Only registered components", "No arbitrary code"],
+ title: "LLM responds in OpenUI Lang",
+ description: "The model returns token-efficient, line-oriented OpenUI Lang (not markdown).",
+ details: [],
},
{
number: 4,
- title: "The OpenUI renderer renders it",
- description: "Accurately turns xq spec into interactive UI.",
- details: ["The Renderer:", "Parses structured output", "Validates against schema", "Streams the responses"],
+ title: "Renderer parses and renders UI",
+ description: "Renderer parses the output and renders interactive UI in real time.",
+ details: [],
},
];
@@ -101,14 +102,17 @@ function Divider() {
function StepDetails({ step, hideDetails }: { step: Step; hideDetails?: boolean }) {
return (
<div className="flex flex-col gap-6">
- <p className="font-['Inter_Display',sans-serif] text-lg text-black/40 leading-[1.2] whitespace-pre-line">
+ <p className="font-['Inter_Display',sans-serif] text-lg text-black/40 leading-[1.2]">
{step.description}
</p>
{!hideDetails && step.details.length > 0 && (
<div className="font-['Inter_Display',sans-serif] text-lg text-black/40 leading-[1.2]">
- {step.details.map((line) => (
- <p key={line}>{line}</p>
- ))}
+ {step.detailsTitle && <p className="mb-2">{step.detailsTitle}</p>}
+ <ul className="list-disc pl-6 space-y-1">
+ {step.details.map((line) => (
+ <li key={line}>{line}</li>
+ ))}
+ </ul>
</div>
)}
</div>
@@ -311,4 +315,4 @@ export function StepsSection() {
</div>
</section>
);
-}
\ No newline at end of file
+}
diff --git a/docs/components/docs-navbar.tsx b/docs/components/docs-navbar.tsx
index 7046a3084..d9208025d 100644
--- a/docs/components/docs-navbar.tsx
+++ b/docs/components/docs-navbar.tsx
@@ -3,7 +3,7 @@
import { useState, useEffect } from 'react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
-import { ThesysLogo, OpenUILogo } from './brand-logo';
+import { OpenUILogo } from './brand-logo';
import { useSearchContext } from 'fumadocs-ui/contexts/search';
import { SidebarTrigger } from 'fumadocs-ui/components/sidebar/base';
import { siteConfig } from '@/lib/layout.shared';
@@ -55,7 +55,6 @@ function SearchBar() {
export function DocsNavbar({ showSidebarToggle = false }: { showSidebarToggle?: boolean }) {
const pathname = usePathname();
- const [isThesysHovered, setIsThesysHovered] = useState(false);
return (
<header className="fixed top-0 inset-x-0 z-40 w-full border-b border-fd-border bg-fd-background/80 backdrop-blur-xl">
@@ -73,9 +72,6 @@ export function DocsNavbar({ showSidebarToggle = false }: { showSidebarToggle?:
{/* Brand */}
<div className="flex items-center gap-2.5 shrink-0">
- <ThesysLogo isHovered={isThesysHovered} onHoverChange={setIsThesysHovered} />
- <span className="font-semibold text-[15px] text-fd-foreground leading-6">thesys</span>
- <span className="text-fd-muted-foreground text-[15px] select-none px-0.5">|</span>
<OpenUILogo />
</div>
diff --git a/docs/components/overview-components/overview-page.tsx b/docs/components/overview-components/overview-page.tsx
index e127c9eda..4c84f1263 100644
--- a/docs/components/overview-components/overview-page.tsx
+++ b/docs/components/overview-components/overview-page.tsx
@@ -10,7 +10,6 @@ import {
TabsList,
TabsTrigger,
TabsContent,
- InlineButton,
} from "@/components/overview-components";
import { genuiOutput } from "./genui";
import { defaultLibrary } from "@openuidev/react-ui";
diff --git a/docs/imports/LlmRespondsInOpenUiLang.tsx b/docs/imports/LlmRespondsInOpenUiLang.tsx
index 3f45477ca..2004a8d73 100644
--- a/docs/imports/LlmRespondsInOpenUiLang.tsx
+++ b/docs/imports/LlmRespondsInOpenUiLang.tsx
@@ -1,85 +1,105 @@
import svgPaths from "./svg-l2c2kzuful";
+const hotelPlazaImg = "/images/home/706ccb488b69a5bdb06bdd002656a2fdfb017071.png";
+const hotelGeorgeVImg = "/images/home/6dea3a71b902a0282d8518928f3b06373b617aba.png";
+const hotelShangriLaImg = "/images/home/d781d9c958cc5cf8f3fc5fd61562ebcf0c7ba0a5.png";
+
+type CardPreviewData = {
+ imageSrc: string;
+ tag: string;
+ tagClassName: string;
+ title: string;
+ description: string;
+};
+
+const CARD_PREVIEWS: CardPreviewData[] = [
+ {
+ imageSrc: hotelPlazaImg,
+ tag: "Free Wifi",
+ tagClassName: "bg-[rgba(13,160,94,0.1)] text-[#067647]",
+ title: "Hotel Plaza Athenee",
+ description: "Haute couture suites; courtyard dining; Dior spa; near Champs-Elysees.",
+ },
+ {
+ imageSrc: hotelGeorgeVImg,
+ tag: "Family-friendly",
+ tagClassName: "bg-[rgba(203,63,73,0.1)] text-[#e94852]",
+ title: "Four Seasons George V",
+ description: "Landmark hotel with opulent rooms, Michelin dining, and a lavish spa.",
+ },
+ {
+ imageSrc: hotelShangriLaImg,
+ tag: "Elite",
+ tagClassName: "bg-[rgba(0,0,0,0.06)] text-black",
+ title: "Shangri-La Hotel",
+ description: "Stunning Eiffel Tower views; Michelin dining; serene spa.",
+ },
+];
function Group() {
return (
<div className="absolute contents left-[49px] top-[48px]">
<div className="absolute bg-black h-[290px] left-[49px] rounded-[16px] top-[48px] w-[443px]" />
- <p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[110px] leading-none left-[73px] not-italic text-[10px] text-white top-[74px] w-[254px] whitespace-pre-wrap">
- Card(header, children)
- <br aria-hidden="true" />
- {`header = Header("sometitle", "somesubtitle")`}
- <br aria-hidden="true" />
- children = [<br aria-hidden="true" />
- {` carousel,`}
- <br aria-hidden="true" />]<br aria-hidden="true" />
- carousel = Carousel(carousel_children)
- <br aria-hidden="true" />
- carousel_children = [<br aria-hidden="true" />
- {` `}
- <br aria-hidden="true" />]
- </p>
+ <p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[198px] leading-none left-[73px] not-italic text-[10px] text-white top-[74px] w-[254px] whitespace-pre-wrap">{`root = Carousel([c1, c2, c3])
+c1 = CarouselCard(
+ "Hotel Plaza Athenee",
+ "Haute couture suites; courtyard dining; Dior spa.",
+ "https://images.example.com/plaza.jpg",
+ "Book"
+)
+c2 = CarouselCard(
+ "Four Seasons George V",
+ "Landmark hotel with opulent rooms and spa.",
+ "https://images.example.com/george-v.jpg",
+ "Book"
+)
+c3 = CarouselCard(
+ "Shangri-La Hotel",
+ "Stunning Eiffel Tower views and Michelin dining.",
+ "https://images.example.com/shangri-la.jpg",
+ "Book"
+)`}</p>
<div className="absolute bg-gradient-to-b from-[rgba(0,0,0,0)] h-[65px] left-[60px] to-black top-[272px] w-[285px]" />
</div>
);
}
-function Frame() {
+function Frame({ imageSrc }: { imageSrc: string }) {
return (
- <div className="aspect-[296/196] bg-[#dbdbdb] overflow-clip relative shrink-0 w-full">
- <div className="absolute h-[80px] left-[3.84px] top-[55.84px] w-[157.5px]">
- <div className="absolute inset-[14.91%_-0.22%_-0.44%_-0.22%]">
- <svg className="block size-full" fill="none" preserveAspectRatio="none" viewBox="0 0 158.207 68.4271">
- <path d={svgPaths.p4c0e640} id="Vector 30" stroke="var(--stroke-0, black)" strokeDasharray="2 2" strokeOpacity="0.1" />
- </svg>
- </div>
- </div>
- <div className="absolute h-[52px] left-[124.84px] top-[60.84px] w-[80.5px]">
- <div className="absolute inset-[22.94%_-0.44%_-0.68%_-0.44%]">
- <svg className="block size-full" fill="none" preserveAspectRatio="none" viewBox="0 0 81.2071 40.4272">
- <path d={svgPaths.pd528680} id="Vector 31" stroke="var(--stroke-0, black)" strokeDasharray="2 2" strokeOpacity="0.1" />
- </svg>
- </div>
- </div>
- <div className="absolute left-[98.34px] size-[31px] top-[14.34px]">
- <div className="absolute inset-[-1.61%]">
- <svg className="block size-full" fill="none" preserveAspectRatio="none" viewBox="0 0 32 32">
- <circle cx="16" cy="16" id="Ellipse 5" r="15.5" stroke="var(--stroke-0, black)" strokeDasharray="2 2" strokeOpacity="0.1" />
- </svg>
- </div>
- </div>
+ <div className="aspect-[296/196] bg-[#dbdbdb] overflow-clip relative shrink-0 w-full rounded-[4px]">
+ <img alt="" className="absolute inset-0 max-w-none object-cover pointer-events-none size-full" src={imageSrc} />
</div>
);
}
-function Frame3() {
+function Frame3({ tag, tagClassName }: Pick<CardPreviewData, "tag" | "tagClassName">) {
return (
<div className="content-stretch flex items-start relative shrink-0">
- <div className="bg-[rgba(13,160,94,0.1)] content-stretch flex gap-[2.888px] h-[23.1px] items-center px-[5.775px] py-[4.331px] relative shrink-0" data-name="Tag">
- <p className="font-['Inter:Regular',sans-serif] font-normal leading-[1.2] not-italic relative shrink-0 text-[#067647] text-[10.11px]">TAG</p>
+ <div className={`content-stretch flex gap-[2.888px] h-[23.1px] items-center px-[5.775px] py-[4.331px] relative shrink-0 ${tagClassName}`} data-name="Tag">
+ <p className="font-['Inter:Regular',sans-serif] font-normal leading-[1.2] not-italic relative shrink-0 text-[10.11px]">{tag}</p>
</div>
</div>
);
}
-function Frame1() {
+function Frame1({ title, description }: Pick<CardPreviewData, "title" | "description">) {
return (
<div className="content-stretch flex flex-col items-start leading-[1.5] not-italic relative shrink-0 text-[11.55px] w-full">
- <p className="font-['Inter:Medium',sans-serif] font-medium relative shrink-0 text-black">Name</p>
- <p className="font-['Inter:Regular',sans-serif] font-normal min-w-full relative shrink-0 text-[rgba(0,0,0,0.4)] w-[min-content] whitespace-pre-wrap">Description goes here</p>
+ <p className="font-['Inter:Medium',sans-serif] font-medium relative shrink-0 text-black">{title}</p>
+ <p className="font-['Inter:Regular',sans-serif] font-normal min-w-full relative shrink-0 text-[rgba(0,0,0,0.4)] w-[min-content] whitespace-pre-wrap">{description}</p>
</div>
);
}
-function Frame2() {
+function Frame2({ className, data }: { className?: string; data: CardPreviewData }) {
return (
- <div className="absolute bg-white content-stretch flex flex-col gap-[8.663px] items-start left-[305px] p-[8.663px] top-[108px] w-[231px]">
+ <div className={`relative bg-white content-stretch flex flex-col gap-[8.663px] items-start p-[8.663px] w-[231px] ${className ?? ""}`}>
<div aria-hidden="true" className="absolute border-[#e4e4e4] border-[1.023px] border-solid inset-0 pointer-events-none shadow-[-4px_0px_10.1px_0px_rgba(0,0,0,0.25)]" />
- <Frame />
- <Frame3 />
- <Frame1 />
+ <Frame imageSrc={data.imageSrc} />
+ <Frame3 tag={data.tag} tagClassName={data.tagClassName} />
+ <Frame1 title={data.title} description={data.description} />
<div className="bg-black content-stretch flex h-[25.988px] items-center justify-between px-[8.663px] py-[5.775px] relative shrink-0 w-[213.675px]" data-name="Primary Button">
<div aria-hidden="true" className="absolute border-[0.722px] border-[rgba(255,255,255,0.08)] border-solid inset-0 pointer-events-none" />
- <p className="font-['Inter:Regular',sans-serif] font-normal leading-[1.5] not-italic relative shrink-0 text-[11.55px] text-white">Action</p>
+ <p className="font-['Inter:Regular',sans-serif] font-normal leading-[1.5] not-italic relative shrink-0 text-[11.55px] text-white">Book</p>
<div className="relative shrink-0 size-[11.55px]" data-name="Icon Container">
<div className="absolute left-0 overflow-clip size-[11.55px] top-0" data-name="16 arrow-right">
<div className="absolute inset-[20.83%]" data-name="Vector">
@@ -153,10 +173,10 @@ function Group1() {
function Group2() {
return (
- <div className="absolute contents left-[219px] top-[16px]">
- <Frame2 />
+ <>
<Group1 />
- </div>
+ <Frame2 data={CARD_PREVIEWS[0]} className="absolute left-[305px] top-[108px] z-30" />
+ </>
);
}
@@ -199,7 +219,7 @@ export default function LlmRespondsInOpenUiLang() {
</div>
</div>
<Group2 />
- <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">OPENUI LANG SNIPPET</p>
+ <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">OPENUI LANG (TOKEN EFFICIENT)</p>
</div>
);
-}
\ No newline at end of file
+}
diff --git a/docs/imports/OpenUiGeneratesSchema.tsx b/docs/imports/OpenUiGeneratesSchema.tsx
index eb3c6cd75..c74ade0fc 100644
--- a/docs/imports/OpenUiGeneratesSchema.tsx
+++ b/docs/imports/OpenUiGeneratesSchema.tsx
@@ -8,82 +8,15 @@ function Group() {
<path d={svgPaths.p1bd62700} fill="var(--fill-0, black)" id="Rectangle 34662625" />
</svg>
</div>
- <p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[262px] leading-[0] left-[73px] not-italic text-[0px] text-[10px] text-white top-[71px] w-[254px] whitespace-pre-wrap">
- <span className="leading-none text-[#ff84cc]">import</span>
- <span className="leading-none">{` { `}</span>
- <span className="leading-none text-[#b3a0fd]">z</span>
- <span className="leading-none">{` } from `}</span>
- <span className="leading-none text-[#bdff52]">{`"zod"`}</span>
- <span className="leading-none">
- <br aria-hidden="true" />
- <br aria-hidden="true" />
- </span>
- <span className="leading-none text-[#ff84cc]">export const</span>
- <span className="leading-none">{` `}</span>
- <span className="leading-none text-[#b29cff]">HotelCardSchema</span>
- <span className="leading-none">
- {` = z.object({`}
- <br aria-hidden="true" />
- {` image: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">
- {`.object({`}
- <br aria-hidden="true" />
- {` src: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">{`.string().min(1, `}</span>
- <span className="leading-none text-[#7cc900]">{`"image.src is required"`}</span>
- <span className="leading-none">),</span>
- <span className="leading-none">
- <br aria-hidden="true" />
- {` alt: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">
- .string().optional()
- <br aria-hidden="true" />
- {` }),`}
- <br aria-hidden="true" />
- <br aria-hidden="true" />
- {` badge: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">
- <br aria-hidden="true" />
- {` .object({`}
- <br aria-hidden="true" />
- {` label: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">{`.string().min(1, `}</span>
- <span className="leading-none text-[#7cc900]">{`"badge.label is required"`}</span>
- <span className="leading-none">),</span>
- <span className="leading-none">
- <br aria-hidden="true" />
- {` // For icons in schema-driven UIs, use an id/name rather than ReactNode`}
- <br aria-hidden="true" />
- {` icon: `}
- </span>
- <span className="leading-none text-[#ae98ff]">z</span>
- <span className="leading-none">
- {`.string().optional(), // e.g. "wifi"`}
- <br aria-hidden="true" />
- {` })`}
- <br aria-hidden="true" />
- {` .optional(),`}
- <br aria-hidden="true" />
- <br aria-hidden="true" />
- {` title: z.string().min(1, "title is required"),`}
- <br aria-hidden="true" />
- <br aria-hidden="true" />
- {` description: z.string().optional(),`}
- <br aria-hidden="true" />
- <br aria-hidden="true" />
- {` cta: z.object({`}
- </span>
- </p>
+ <p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[262px] leading-none left-[73px] not-italic text-[10px] text-white top-[71px] w-[254px] whitespace-pre-wrap">{`import { library } from "./library"
+
+const systemPrompt = library.prompt()
+
+const completion = await client.chat.completions.create({
+ model: "gpt-5.2",
+ stream: true,
+ messages: [{ role: "system", content: systemPrompt }, ...messages]
+})`}</p>
<div className="absolute bg-gradient-to-b from-[rgba(0,0,0,0)] h-[64px] left-[60px] to-black top-[272px] w-[285px]" />
</div>
);
@@ -168,10 +101,10 @@ function Frame2() {
export default function OpenUiGeneratesSchema() {
return (
- <div className="overflow-clip relative rounded-[16px] size-full" data-name="OpenUI generates schema">
+ <div className="overflow-clip relative rounded-[16px] size-full" data-name="OpenUI generates prompt">
<Group />
<Frame2 />
- <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">ZOD SCHEMA</p>
+ <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">SEND SYSTEM PROMPT TO LLM</p>
</div>
);
}
diff --git a/docs/imports/YouRegisterComponents-43-365.tsx b/docs/imports/YouRegisterComponents-43-365.tsx
index 28174ef9f..884a04d9f 100644
--- a/docs/imports/YouRegisterComponents-43-365.tsx
+++ b/docs/imports/YouRegisterComponents-43-365.tsx
@@ -72,65 +72,32 @@ export default function YouRegisterComponents() {
<div className="relative size-full" data-name="You register components">
<div className="absolute h-[432px] left-0 rounded-[16px] top-0 w-[610px]" data-name="image 4" />
<div className="absolute bg-black h-[290px] left-[49px] rounded-[16px] top-[48px] w-[443px]" />
- <div className="absolute font-['Andale_Mono:Regular',sans-serif] leading-[0] left-[86px] not-italic text-[0px] text-[9px] text-white top-[102px] whitespace-nowrap">
- <p className="mb-0">
- <span className="leading-none">{`export interface `}</span>
- <span className="leading-none text-[#b3a0fd]">HotelCardProps</span>
- <span className="leading-none">{` {`}</span>
- </p>
- <p className="leading-none mb-0">{` image: {`}</p>
- <p className="mb-0">
- <span className="leading-none">{` src: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` alt?: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="leading-none mb-0">{` }`}</p>
- <p className="leading-none mb-0">&nbsp;</p>
- <p className="leading-none mb-0">{` badge?: {`}</p>
- <p className="mb-0">
- <span className="leading-none">{` label: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` icon?: `}</span>
- <span className="leading-none text-[#b3a0fd]">React.ReactNode</span>
- </p>
- <p className="leading-none mb-0">{` }`}</p>
- <p className="leading-none mb-0">&nbsp;</p>
- <p className="mb-0">
- <span className="leading-none">{` title: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` description?: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="leading-none mb-0">&nbsp;</p>
- <p className="leading-none mb-0">{` cta: {`}</p>
- <p className="mb-0">
- <span className="leading-none">{` label: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` onClick?: () => `}</span>
- <span className="leading-none text-[#ff7979]">void</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` href?: `}</span>
- <span className="leading-none text-[#b3a0fd]">string</span>
- </p>
- <p className="mb-0">
- <span className="leading-none">{` icon?: `}</span>
- <span className="leading-none text-[#b3a0fd]">React.ReactNode</span>
- </p>
- <p className="leading-none mb-0">{` }`}</p>
- <p className="leading-none">{`}`}</p>
- </div>
- <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">HOTEL CARD REACT PROPS</p>
+ <p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[262px] leading-none left-[73px] not-italic text-[10px] text-white top-[71px] w-[254px] whitespace-pre-wrap">{`import { z } from "zod"
+import { defineComponent, createLibrary } from "@openuidev/lang-react"
+
+const CarouselCard = defineComponent({
+ name: "CarouselCard",
+ props: z.object({
+ title: z.string(),
+ description: z.string().optional(),
+ imageUrl: z.string().url(),
+ ctaLabel: z.string(),
+ }),
+})
+
+const Carousel = defineComponent({
+ name: "Carousel",
+ props: z.object({
+ cards: z.array(CarouselCard.ref),
+ }),
+})
+
+export const library = createLibrary({
+ root: "Carousel",
+ components: [Carousel, CarouselCard],
+})`}</p>
+ <p className="absolute font-['Geist_Mono:Medium',sans-serif] font-medium leading-none left-[58px] text-[12px] text-[rgba(0,0,0,0.4)] top-[366px]">DEFINE COMPONENT + LIBRARY</p>
<Frame2 />
</div>
);
-}
\ No newline at end of file
+}