stdout-design

Configuration

The studio.config.ts reference templates, presets, locales, fonts, and output.

studio.config.ts lives at your project root and declares everything the studio needs: your template registry, output presets, locales, fonts, and output directory. It's a plain TypeScript file validated at runtime with Zod.

// studio.config.ts
import type { StudioConfig } from "@stdout-design/core";

const config: StudioConfig = {
  defaultPreset: "instagram-square",
  outDir: "./out",
  locales: ["en", "ar"],
  presets: [
    {
      id: "instagram-square",
      width: 1080,
      height: 1080,
      platform: "instagram",
    },
    { id: "x-card", width: 1200, height: 675, platform: "x" },
    { id: "og-image", width: 1200, height: 630, platform: "web" },
  ],
  templates: {
    "bento-feature": {
      componentPath: "./templates/bento-feature",
      description: "Apple-style bento feature card.",
    },
    "stat-card": {
      componentPath: "./templates/stat-card",
      description: "A milestone or stat card for social media.",
    },
  },
};

export default config;

Fields

FieldTypeRequiredDescription
templatesRecord<string, { componentPath, description? }>YesThe template registry (see below)
presetsArray<{ id, width, height, platform }>YesOutput sizes (see below)
defaultPresetstringNoPreset ID used by default
localesstring[]NoSupported locale codes, e.g. ["en", "ar"]
outDirstringNoOutput directory (default ./out)
fontsRecord<locale, FontConfig[]>NoPer-locale font config (see Internationalization)
scaffoldVersionstringNoWritten by init/update; not for manual edits

templates

Maps a template ID to its component file. The ID is what you pass to studio render, and the key used in locale files.

templates: {
  "stat-card": {
    componentPath: "./templates/stat-card", // .tsx added automatically
    description: "A milestone or stat card for social media.",
  },
},

componentPath is required and points at the .tsx file without the extension.

presets

Presets are fully user-defined there's no fixed built-in set. Each one is { id, width, height, platform }, where platform is informational (shown in the studio) and width/height are the output dimensions in pixels.

Rendering without --preset produces one image per preset. Common platform sizes you can use:

Preset IDSizeUse
og1200×630Open Graph / social cards
x-card1200×675X (Twitter) cards
linkedin1200×627LinkedIn link previews
instagram1080×1080Instagram feed posts
instagram-square1080×1080Instagram feed posts
instagram-story1080×1920Instagram stories
appstore1290×2796App Store screenshots
playstore1080×1920Play Store screenshots

These are just sizes name and use them however fits your workflow.

defaultPreset

The preset selected by default in the studio and render fallbacks. If omitted, the first preset in the array is used.

Validation & errors

studio.config.ts is loaded and validated on every command and by the dev server. Failures are reported as clear errors:

  • Missing file No studio.config.ts found in <root>.
  • Invalid shape studio.config.ts is invalid: <path>: <message>; ... e.g. a missing componentPath, or a preset with non-positive dimensions.

templates and presets are both required; a config missing either fails validation.

Example: a full multi-platform setup

import type { StudioConfig } from "@stdout-design/core";

const config: StudioConfig = {
  defaultPreset: "instagram-square",
  outDir: "./out",
  locales: ["en", "ar"],
  presets: [
    {
      id: "instagram-square",
      width: 1080,
      height: 1080,
      platform: "instagram",
    },
    { id: "instagram-story", width: 1080, height: 1920, platform: "instagram" },
    { id: "x-card", width: 1200, height: 675, platform: "x" },
    { id: "linkedin", width: 1200, height: 627, platform: "linkedin" },
    { id: "og-image", width: 1200, height: 630, platform: "web" },
  ],
  templates: {
    "bento-feature": {
      componentPath: "./templates/bento-feature",
      description:
        "Apple-style bento feature card with image, headline, and tag badges.",
    },
    "stat-card": {
      componentPath: "./templates/stat-card",
      description: "A milestone or stat card for social media.",
    },
  },
};

export default config;

On this page