Skill: Quanta Design

Higgsfield-SDK apps only. Use Quanta ONLY for app surfaces that integrate the Higgsfield fnf SDK — generation consoles and fnf-backed tools (image/video generation, media upload, profile, workspace, credits, generation feed/history) — for layout, styling, fonts, buttons, components, responsive composition, empty/loading/error states, and premium polish.

Do not use for anything that does not call the Higgsfield SDK — marketing/ landing pages, portfolios, brochure/creative sites, and general SaaS/dashboards/ tools build from their template recipe with custom Tailwind/CSS, not @higgsfield/quanta/* components or q-prefixed semantic utilities.

This skill has two layers. Layer 1 (UX Craft) decides what to build and how it must behave — surface choice, interaction, keyboard, forms, motion, states. Layer 2 (Quanta Implementation) decides what everything is made of — tokens, components, typography, spacing. Never invent colors, fonts, or component styles: those decisions are already made by Quanta. UX rules below are expressed in Quanta vocabulary on purpose.

Before coding, read app/packages/quanta/ai/AGENTS.md. That package guide is the canonical Quanta API/token reference — RELY ON IT for component props, variants, and tokens; do NOT open or grep the component .tsx source to re-derive prop names (it's already documented there, and re-deriving it wastes time). This skill explains how this template must compose Quanta into generated fnf-SDK app UIs.

One exception to "don't read the source": compound-component parts. For a prop on a compound part (Modal.Header, Modal.Footer, Card.*, Vault.*, Grid) whose mistake is a HARD compile error — or worse, a SILENT one — a 10-second look at that one component file is worth it. Known traps:


LAYER 1 — UX CRAFT

These rules fix the "almost right but feels off" class of bugs: dead hover states, unlabeled icons, forms that yell on every keystroke, spinners that never end, modals you can't escape. They are ranked: CRITICAL rules are never skipped; HIGH/MEDIUM rules are skipped only with a concrete reason.

Surface Selection (what to build first)

Match the first screen to the product type. The product surface itself is screen one — never a splash, never a marketing hero.

Product type Surface shape Base recipe
Generator / console (image, video, audio) Prompt box on center in main page + settings pane in prompt box, results screen after first generation with gallery Studio layout — app/src/layouts/studio.tsx (references/app-layouts.md)
Feed / gallery / history Filterable grid or list, item overlay/inspector App shell + grid section
Editor / notes / project tool List sidebar, work canvas, optional inspector Split editor/tool
Board / pipeline Horizontal scroll columns inside fixed shell App shell, overflow-x-auto region
Settings / profile / billing Single constrained column of grouped sections Form panel
Dashboard / stats Bands of metric groups, one chart per question App shell + sections

Density: consoles and tables run tight (gap-3, p-4); content-first surfaces (feed, gallery, forms) run spacious (gap-4 md:gap-6, p-4 md:p-6 xl:p-8). Pick one density per region, not per element.

Interaction (CRITICAL)

Keyboard & Focus (CRITICAL)

Overlay Layering (CRITICAL)

Forms & Feedback (HIGH)

Layout & Responsive (HIGH)

Motion (MEDIUM)

Data & Charts (LOW — dashboards only)


LAYER 2 — QUANTA IMPLEMENTATION

Higgsfield Integration Rules

Apps render INSIDE Higgsfield — they must be indistinguishable from Higgsfield's own products.

  1. NEVER customize Quanta styles, and NEVER modify Quanta itself. No className overrides that change a component's look, no color/size/font overrides on quanta components, no re-theming, and never edit the vendored @higgsfield/quanta package. Compose, don't restyle. If a Quanta component doesn't fit without customization (a variant/behavior it doesn't offer), do NOT bend it — build a small custom component from Quanta primitives instead (rule 5).
  2. NO app header. Apps render inside Higgsfield, whose chrome already provides the global header, credits/balance, and account controls — never add a top header/app bar, brand/logo row, or nav bar inside the app, and never render credits/balance or sign-out controls. In-app navigation lives in a Quanta Sidebar (see the Studio layout, app/src/layouts/studio.tsx) or inline controls (tabs, steppers); a page title is just a heading inside the work area.
  3. When a piece of UI you want doesn't exist in Quanta, build it inside the app from Quanta primitives with zero customization — never import a third-party UI library or hand-roll a different visual language (see rule 5).
  4. Always dark. The template pins data-theme="default-dark" (+ color-scheme: dark) on <html> — apps are permanently dark like every Higgsfield product. Never add a theme toggle or a light mode, never use dark:-conditional styling (there is no light state), and never wire quanta's bootstrapScript/ThemeController theme switching.
  5. Fill gaps with your OWN components, built from Quanta primitives + q- tokens, in the app's own app/src/components/ (date picker, calendar, sortable data table, multiselect autocomplete, color picker, …). Compose Quanta primitives (Button, Input, Dropdown, Popover, Modal, …) and q- utility classes into the piece you need, matching Quanta's tokens and spacing so it's indistinguishable from a built-in. There is NO fallback design system: never add a third-party UI dependency (no shadcn, no MUI, no Radix, etc.), and never restyle a Quanta component to force a fit.

Template Wiring

Quanta is already wired through app/src/styles.css.

Keep these pieces:

Do not remove or duplicate these imports. Do not import Quanta CSS again inside individual components.

Responsive variants: Tailwind defaults (sm: md: lg: xl:) plus quanta's q-tablet: (768px), q-desktop: (1280px), q-wide: (1920px). tablet:/desktop: do NOT exist — they compile to nothing.

Current Spacing And Token Rules

This is the rule agents must remember:

Good:

<main className="min-h-dvh bg-q-background-primary p-4 text-q-text-primary md:p-6">
  <section className="grid gap-4 xl:grid-cols-[280px_1fr]">
    ...
  </section>
</main>

Bad:

<main className="bg-background-primary px-400 py-300 text-sm font-medium">
  ...
</main>

Component Priority

Use Quanta components before legacy app/src/components/ui/*, before direct Radix, and before third-party equivalents.

Need Use
Actions and links Button from @higgsfield/quanta/button
Top navigation NavigationMenu from @higgsfield/quanta/navigation-menu
App navigation rail Sidebar from @higgsfield/quanta/sidebar
Text fields Input from @higgsfield/quanta/input
Generation prompt surface BUILD it from Quanta primitives per the composer anatomy in references/app-layouts.md (glass card, attachments strip, chips row, tall marketingPrimary GENERATE) — there is no prompt-box component
Multi-line text (non-prompt) Textarea from @higgsfield/quanta/textarea
Binary settings Switch, Checkbox, Toggle
Exclusive choices RadioGroup, RadioLabel from @higgsfield/quanta/radio
Option pickers (settings) Select from @higgsfield/quanta/select
Segmented modes/views Tabs
Menus/model pickers Dropdown
Command palette/search actions Command from @higgsfield/quanta/cmdk
Dialog/editor/confirm Modal
Edge sheet/mobile panel Vault
Toasts Toaster, toast from @higgsfield/quanta/sonner
Progress/loading Progress
In-button/inline busy spinner Loader from @higgsfield/quanta/loader
Generation feeds / result grids Grid from @higgsfield/quanta/grid (cols="auto-fit" + minColWidth for generation feeds — never breakpoint column ladders)
Metadata/status Badge, Tag, Dot, Kbd, Avatar, Divider

Legacy shadcn-style components may remain for scaffold compatibility, but new client UI should not start there. Also do not import cmdk, sonner, or vaul directly for new UI; Quanta already wraps those interaction patterns with the correct visual system.

Core Imports

import { Button } from '@higgsfield/quanta/button'
import { Input } from '@higgsfield/quanta/input'
import { Textarea } from '@higgsfield/quanta/textarea'
import { NavigationMenu } from '@higgsfield/quanta/navigation-menu'
import { Sidebar } from '@higgsfield/quanta/sidebar'
import { Tabs } from '@higgsfield/quanta/tabs'
import { Dropdown } from '@higgsfield/quanta/dropdown'
import { Select } from '@higgsfield/quanta/select'
import { Grid } from '@higgsfield/quanta/grid'
import { Loader } from '@higgsfield/quanta/loader'
import { Modal } from '@higgsfield/quanta/modal'
import { Vault } from '@higgsfield/quanta/vault'
import { Toaster, toast } from '@higgsfield/quanta/sonner'

Mount one <Toaster /> near the root shell before calling toast.*.

Premium App Layout Rules

Generated app UIs must look designed, not like raw low-level layouts.

  1. Start with the product surface. If the task is a notes app, editor, dashboard, generator, gallery, CRM, or workspace, make that actual interface the first screen. Use the Surface Selection table in Layer 1 to pick the shape.
  2. Use a stable shell. Prefer min-h-dvh bg-q-background-primary text-q-text-primary and scroll regions with min-h-0 overflow-auto. No header/top bar — apps render inside Higgsfield; actions live in the work area's own toolbar row or the sidebar.
  3. Use meaningful regions. Most product tools need a sidebar/list, a main work area, and optionally an inspector/action rail.
  4. Give regions enough space. Start with p-4 md:p-6 xl:p-8, gap-4 md:gap-6, and tighten only for dense tables/toolbars.
  5. Constrain text and panels. Use min-w-0, truncate, max-w-*, grid-cols-*, and minmax(0,1fr) patterns so content never overlaps.
  6. Make state visible. Selected rows, hover states, focus states, empty states, loading states, and errors should be designed surfaces, not bare text.
  7. Avoid card soup. Do not put cards inside cards inside cards. Use shells, sidebars, bands, lists, workspaces, and repeated item cards only where they are semantically useful.
  8. Use icons for tools. Icon-only buttons need iconOnly and an accessible label. Do not write text labels into tiny square controls. Never use emojis as icons — vector icons only, ONE icon family: Google Material Symbols outlined 400, imported per icon (import Star from "@material-symbols/svg-400/outlined/star_shine.svg?react", sized via width/height props); -fill variants only for very small glyphs.
  9. Keep palettes balanced. Quanta already provides dark surfaces and brand accents. Avoid one-note purple/blue gradients, random blur blobs, and raw decorative shapes.

Layout Recipes

Code layouts (preferred starting points)

The template ships six layout screens as REAL CODE in app/src/layouts/ — start from the closest one, copy it into your route, and adapt it from the code (and the reusable pieces in app/src/components), never from a screenshot. See references/app-layouts.md + app/src/layouts/AGENTS.md for each one's full anatomy.

Product shape Code layout (copy + adapt)
Full workspace — projects sidebar + prompt composer + generations feed app/src/layouts/studio.tsx
Pick-a-style-then-generate — preset/template gallery + a creation rail app/src/layouts/preset.tsx
Single tool's landing/detail page — two-column generator hero + how-it-works app/src/layouts/app-detail.tsx
Upload-configure-iterate workspace (try-on / restyle / character) app/src/layouts/ai-stylist.tsx
Before/after enhance tool (retouch / restore / upscale) app/src/layouts/skin-enhancer.tsx
Step-by-step generate → select → refine wizard app/src/layouts/shots.tsx

When none fits and the user asks for a custom shell, compose one of the generic shapes below.

App shell

No app header — the title/actions are a row inside the work area; Higgsfield's host chrome provides the global header.

<div className="min-h-dvh bg-q-background-primary text-q-text-primary">
  <main className="grid min-h-dvh grid-cols-1 xl:grid-cols-[280px_minmax(0,1fr)]">
    <aside className="min-h-0 border-r border-q-border-subtle p-4">...</aside>
    <section className="min-h-0 overflow-auto p-4 md:p-6">
      <div className="mb-4 flex flex-wrap items-center justify-between gap-3">
        <h1 className="text-q-title-md-semi-bold">Workspace</h1>
        <Button size="sm">Create</Button>
      </div>
      ...
    </section>
  </main>
</div>

Split editor/tool

Use this for notes, editors, project feeds, and dashboards.

<main className="grid min-h-dvh grid-cols-1 bg-q-background-primary text-q-text-primary xl:grid-cols-[320px_minmax(0,1fr)_360px]">
  <aside className="min-h-0 overflow-auto border-r border-q-border-subtle p-4">...</aside>
  <section className="min-h-0 overflow-auto p-6">...</section>
  <aside className="min-h-0 overflow-auto border-l border-q-border-subtle p-4">...</aside>
</main>

Collapse sidebars behind Tabs, Dropdown, or Vault on smaller screens when space is tight.

Form panel

<section className="mx-auto grid w-full max-w-3xl gap-5 p-4 md:p-6">
  <div className="grid gap-2">
    <h1 className="text-q-title-lg-semi-bold">Generate image</h1>
    <p className="text-q-body-md-regular text-q-text-secondary">Tune the prompt and settings.</p>
  </div>
  <div className="grid gap-4 rounded-lg border border-q-border-subtle bg-q-background-secondary p-4">
    <Textarea label="Prompt" rows={5} />
    <Button variant="marketingPrimary">Generate</Button>
  </div>
</section>

Use cards for real grouped content, not as a wrapper around every section.

Typography Rules

Use Quanta composite typography utilities. Do not make the whole app text-sm font-medium.

The composite utilities carry the brand fonts: title/headline/display utilities render Space Grotesk (the brand headline face) and body renders Inter — use the composite utility and the right font comes with it. Never import fonts.

Use Utility
App page title / hero in a tool surface text-q-headline-sm-semi-bold or text-q-headline-md-semi-bold
Large in-app display (generator headline) text-q-display-lg-bold or text-q-display-md-bold
Section title text-q-title-md-semi-bold
Item title text-q-title-sm-semi-bold or text-q-label-lg-semi-bold
Body text-q-body-md-regular
Meta/help text-q-body-sm-regular or text-q-caption-sm-medium
Code/ids text-q-mono-sm-regular

Color text with semantic utilities:

Readability details: prefer wrapping over truncation; when truncating, add truncate + title. Use tabular-nums for counters, prices, timers, and table number columns so digits don't jitter.

Button Rules

Use @higgsfield/quanta/button.

import { Button } from '@higgsfield/quanta/button'
import { Loader } from '@higgsfield/quanta/loader'

State Rules

Every generated app UI should have credible states:

Debugging Missing Styles

When styles look missing or spacing collapses:

  1. Check app/src/styles.css still imports @higgsfield/quanta/tailwind.css.
  2. Check @source "../packages/quanta/src"; is present.
  3. Check @theme { --spacing: 0.25rem; } is still present after the Quanta import to restore normal Tailwind layout spacing in generated app UIs.
  4. Check the app uses native spacing (p-4, gap-2) and q-prefixed semantic utilities (bg-q-*, text-q-*).
  5. Check imports are from Quanta subpaths like @higgsfield/quanta/button.
  6. Check app/packages/quanta/package.json still depends on @base-ui/react.

Run a quick stale-spacing scan when layouts look wrong:

rg 'px-400|p-400|py-300|mt-300|gap-200' app/src app/packages/quanta/ai

Fix any hits in app/source code to native spacing (px-4, py-3, mt-3, gap-2). It is fine for docs to mention old classes only inside bad examples.

Anti-Patterns

Pre-Delivery Checklist

Mechanical scan first:

rg 'px-400|p-400|py-300|mt-300|gap-200|bg-(red|blue|zinc|gray|slate|neutral)-\d|text-(zinc|gray|slate|neutral)-\d|text-\[\d+px\]|#[0-9a-fA-F]{3,6}' app/src

Any hit in app source is a defect (docs/bad-examples excluded).

Then verify by hand: