Configuration

Strata apps are configured through two JSON files and CMake options.

strata.json

The app manifest defines window settings, C bindings, and reactive queries:

{
  "name": "my-app",
  "displayName": "My App",
  "version": "0.1.0",
  "driver": "sui",
  "window": {
    "title": "My App",
    "width": 1280,
    "height": 720,
    "resizable": true,
    "maximized": false
  },
  "bindings": [],
  "queries": []
}

Top-level fields

FieldTypeDescription
namestringApp identifier (lowercase, alphanumeric + dashes)
displayNamestringHuman-readable app name
versionstringSemver version string
driverstring"sui" for SUI apps, omit for React
windowobjectWindow configuration
bundlestringPath to JS bundle (React apps only)
bindingsarrayC functions callable from JS/SUI
queriesarrayReactive data flowing from C to JS/SUI

Window settings

FieldTypeDefaultDescription
titlestringApp nameWindow title
widthnumber1280Initial window width
heightnumber720Initial window height
resizablebooleantrueWhether the window can be resized
maximizedbooleanfalseStart maximized

Bindings

Define C functions callable from JavaScript or SUI:

{
  "bindings": [
    {
      "name": "doSomething",
      "namespace": "myApp",
      "args": [
        { "name": "value", "type": "i32" },
        { "name": "label", "type": "string" }
      ],
      "returns": "bool",
      "doc": "Does something with the value"
    }
  ]
}

Valid types: bool, i32, i64, f32, f64, string, void

Codegen creates:

  • generated/<prefix>_bindings.h — C header with function signatures to implement
  • generated/<prefix>_bindings.c — Bridge code (auto-generated)
  • generated/native.d.ts — TypeScript declarations

Queries

Define data that flows reactively from C to JS/SUI:

{
  "queries": [
    {
      "name": "document",
      "namespace": "myApp",
      "returns": "object",
      "schema": {
        "type": "object",
        "props": {
          "width": { "type": "i32" },
          "height": { "type": "i32" },
          "title": { "type": "string", "nullable": true }
        }
      }
    }
  ]
}

Valid query types: bool, i32, i64, f32, f64, string, object, array

Codegen creates:

  • generated/<prefix>_queries.h — C header with query function signatures
  • generated/<prefix>_queries.c — Query table registration
  • generated/queries.ts — TypeScript hooks (e.g., useMyAppDocument())

theme.json

Defines light and dark color palettes. All color keys are required.

{
  "mode": "dark",
  "light": {
    "colors": {
      "surface": "#FFFFFF",
      "surfaceMuted": "#F5F6FA",
      "surfaceElevated": "#FFFFFF",
      "surfaceHover": "#F0F2F8",
      "surfacePressed": "#E8EBF2",
      "border": "#E2E4EB",
      "borderMuted": "#EBEDF2",
      "text": "#1C202A",
      "textMuted": "#787E8E",
      "primary": "#3B5BDB",
      "primaryHover": "#496AEB",
      "primaryPressed": "#304ABE",
      "primaryText": "#FFFFFF",
      "primaryBorder": "#304ABE",
      "danger": "#DC3545",
      "dangerHover": "#EB4454",
      "dangerPressed": "#BE2837",
      "dangerText": "#FFFFFF",
      "dangerBorder": "#BE2837",
      "overlay": "#0F121C8C",
      "secondary": "#8B5CF6",
      "accent": "#06B6D4",
      "background": "#FAFAFC",
      "textSecondary": "#787E8E",
      "error": "#DC3545",
      "success": "#22C55E",
      "warning": "#F59E0B"
    }
  },
  "dark": {
    "colors": {
      "surface": "#161921",
      "surfaceMuted": "#1C1F28",
      "surfaceElevated": "#202430",
      "surfaceHover": "#262A38",
      "surfacePressed": "#2D3242",
      "border": "#303644",
      "borderMuted": "#262A36",
      "text": "#EBEEF5",
      "textMuted": "#8C94A8",
      "primary": "#6E82FF",
      "primaryHover": "#8296FF",
      "primaryPressed": "#5A6EDC",
      "primaryText": "#FFFFFF",
      "primaryBorder": "#5A6EDC",
      "danger": "#FF5F5F",
      "dangerHover": "#FF7878",
      "dangerPressed": "#E64B4B",
      "dangerText": "#12141A",
      "dangerBorder": "#E64B4B",
      "overlay": "#05060AC8",
      "secondary": "#8B5CF6",
      "accent": "#06B6D4",
      "background": "#0F1117",
      "textSecondary": "#94A3B8",
      "error": "#EF4444",
      "success": "#22C55E",
      "warning": "#F59E0B"
    }
  }
}

Color keys

KeyDescription
surfaceDefault surface background
surfaceMutedSubdued surface variant
surfaceElevatedElevated surface (cards, modals)
surfaceHoverSurface hover state
surfacePressedSurface pressed state
borderDefault border color
borderMutedSubdued border variant
textPrimary text color
textMutedSecondary/muted text color
textSecondaryAlternative secondary text color
primaryPrimary brand color
primaryHoverPrimary hover state
primaryPressedPrimary pressed state
primaryTextText on primary surfaces
primaryBorderBorder for primary elements
secondarySecondary accent color
accentTertiary accent color
dangerDestructive action color
dangerHoverDanger hover state
dangerPressedDanger pressed state
dangerTextText on danger surfaces
dangerBorderBorder for danger elements
backgroundPage/app background
overlayModal/overlay backdrop (supports alpha)
errorError state color
successSuccess state color
warningWarning state color

The mode field ("light" or "dark") sets which palette is active by default.

CMake options

All options should be set before calling FetchContent_MakeAvailable.

Core features

OptionDefaultDescription
SV2_ENABLE_SCRIPTINGOFFEnable JavaScript scripting support
SV2_ENABLE_QUICKJSONBuild QuickJS backend (only used when scripting is on)
SV2_ENABLE_HERMESOFFBuild Hermes backend (only used when scripting is on)
SV2_ENABLE_REACTOFFBuild React renderer bundle (requires scripting + QuickJS)
SV2_ENABLE_NETOFFEnable networking (fetch) via libcurl
SV2_ENABLE_SUIOFFBuild SUI DSL compiler and runtime
SV2_ENABLE_NODE_RUNTIMEOFFBuild Node.js N-API runtime

Renderer backends

OptionDefaultDescription
SV2_RENDERER_BACKEND_SDLONBuild SDL GPU backend
SV2_RENDERER_BACKEND_WEBGPUOFFBuild WebGPU backend via wgpu-native
SV2_PLATFORM_GLFWOFFBuild GLFW platform host (requires WebGPU)
SV2_RENDER_TREE_BACKEND"C"Render tree backend: "C" or "Rust"

Build configuration

OptionDefaultDescription
SV2_ENABLE_INSTALLOFFEnable install/export targets
SV2_BUILD_RUNNEROFFBuild windowed runner applications
SV2_ESBUILD_EXECUTABLEautoPath to esbuild binary
STRATA_V2_SDL3_SOURCE_DIR""Path to local SDL3 source checkout
SDL_SHADERCROSS_DIR""Path to pre-built SDL_shadercross

Option dependencies

Some options implicitly enable others:

  • SV2_ENABLE_REACT=ON requires SV2_ENABLE_SCRIPTING=ON and SV2_ENABLE_QUICKJS=ON
  • The full React stack auto-enables SV2_ENABLE_NET
  • SV2_PLATFORM_GLFW requires SV2_RENDERER_BACKEND_WEBGPU=ON
  • SV2_RENDERER_BACKEND_SDL=ON is required by strata_runtime