Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search…
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro

Set up your local dev environment

Install prerequisites and configure your local environment for AI-orchestrated development.
Updated 15d ago
Introduction to vibe coding
Essential tools for vibe coding
A vibe-coding setup has two halves: the ordinary Node toolchain your app runs on, and the harness that keeps your AI agent honest about the Once UI API. This page covers both, in the order you should do them.

What you'll need

  • Node 20 or newer — Once UI targets >=20.x. Check with node -v.
  • A package manager — npm ships with Node; pnpm and bun work too.
  • Git, for cloning starters and tracking what your agent changes.
  • An editor with an agent — Cursor, Windsurf, VS Code with Copilot, or Claude Code in the terminal.

Add Once UI to a project

In an existing Next.js App Router project, install the package:
npm install @once-ui-system/core
Then import the stylesheets once, in your root layout, before your own styles:
import "@once-ui-system/core/css/styles.css";
import "@once-ui-system/core/css/tokens.css";
Everything else — components, hooks, contexts, icons — comes from the package root or its subpaths. You do not add a CSS framework alongside it; spacing, color, and typography are token props on the components themselves.

Wire the AI harness

This is the step most people skip, and it is the one that decides whether your agent writes real Once UI or plausible-looking guesses. Run the scaffolder once, from your project root:
npx once-ui-init-agent
It writes two files: an AGENTS.md section describing the harness and how to consult it, and a Cursor rule at .cursor/rules/once-ui-codegen.mdc. Both point your agent at the machine-readable spec that ships inside the package — the component catalog, per-component prop slices, task bundles, and the list of known gotchas. Commit both files. They are project configuration, not scratch output, and an agent that cannot find them falls back to memory.

Give your agent live docs

For "how does X work?" questions that go beyond the shipped spec, agents can pull documentation over MCP. Add Context7 to your client's MCP configuration:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"]
    }
  }
}
The Once UI library is indexed there as /once-ui-system/core. Point questions at that library id rather than letting the agent search the open web, where it will find posts about older versions.

Verify the setup

Two checks tell you the environment is real rather than merely installed.
First, generate or write a small component, then run the validator that ships with the package:
It reports mechanical mistakes — unknown icon names, redundant default props, raw HTML where a component exists, hardcoded colors. A clean run means the file is at least idiomatic.
Second, start the dev server and confirm the tokens actually loaded:
If text and surfaces render unstyled, the stylesheet imports in your root layout are missing or in the wrong order.

A note on keeping it current

Pin the Once UI version in package.json rather than floating on latest, and re-run npx once-ui-init-agent after upgrading a minor version — the harness files describe the version you have installed, and a stale copy teaches your agent an API that no longer exists.
npx once-ui-validate-ai-code src/app/page.tsx
npm run dev