Configuration
The fields, defaults, and constraints accepted by brandtree.config.ts.
brandtree.config.ts is the single source of structured brand data and site
settings. Use defineConfig from brandtree for editor completion; the CLI
validates values when it loads the project. Unknown fields are rejected.
For a guided setup, start with Brand configuration. This page follows the config object’s structure so you can find a field quickly.
Define and validate your config
This is the shape of a config file, not a complete runnable configuration. Keep the required brand sections from the Quickstart starter.
import { defineConfig } from "brandtree";
export default defineConfig({
brand: {
// Required: meta, colors, theme, typography, logo, and contact.
},
navigation: { numbering: true },
});
The loader recognizes brandtree.config.ts, .mts, .js, .mjs, and .cjs,
in that order. Keep one config file. A config-free project does not currently
provide a complete brand automatically.
brandBrandConfig
Structured identity, colors, themes, typography, logos, contacts, and optional downloads and translations.
BrandConfigfonts?FontConfig[]
Font loading declarations. An explicit array replaces the default; [] disables font downloads.
FontConfig[]Inter (Google)basePath?string
Route mount point such as /guidelines, normalized to an empty string or /segment. Does not add a sidebar group.
string""navigation?{ numbering?: boolean }
Whether sidebar sections display numbers. See Navigation.
{ numbering?: boolean }{ numbering: false }i18n?I18nConfig
Opt-in locales, content parser, URL prefix policy, and fallback. See Localization.
I18nConfigseo?{ og?: OgConfig }
Generated social-card settings. See Social cards and SEO.
{ og?: OgConfig }{ og: { enabled: true } }Brand fields
metaBrandMeta
Identity and document metadata.
BrandMetacolors{ palette: PaletteFamily[]; swatches: Swatch[] }
Authored color values and approved brand swatches.
{ palette: PaletteFamily[]; swatches: Swatch[] }theme{ default: 'light' | 'dark' | 'system'; light: Scheme; dark: Scheme }
Complete semantic color roles for both themes.
{ default: 'light' | 'dark' | 'system'; light: Scheme; dark: Scheme }typographyBrandTypography
Font stacks, family descriptions, weights, and type scale.
BrandTypographylogoBrandLogo
Artwork variants and usage specifications.
BrandLogocontactBrandContact
Optional public contact fields. An empty object is allowed.
BrandContactdownloads?BrandDownload[]
Shared downloadable resources and their display metadata.
BrandDownload[]localeOverrides?Record<string, BrandLocaleOverride>
Reader-facing copy and typography stacks by configured locale code. Requires root i18n.
Record<string, BrandLocaleOverride>Brand metadata
All paths below are relative to brand.meta.
namestring
Public brand name.
stringlegalName?string
Registered legal name.
stringtagline?string
Short brand tagline.
stringdocumentTitlestring
Guidelines document label.
stringversionstring
Brand-document version, independent of the package version.
stringyearnumber
Document year.
numberurlstring
Production origin used by the generated site and absolute metadata URLs.
stringdescriptionstring
Site description.
stringSee Brand identity for an example and the distinction between structured identity and editorial brand stories.
Color families and swatches
brand.colors.palette contains families with required id, name, and
shades. Each shades object must contain all eleven stops: 50, 100, 200,
300, 400, 500, 600, 700, 800, 900, and 950.
A shade uses { space: "hex", value: "#64748b" } or
{ space: "oklch", l: 0.55, c: 0.12, h: 250, alpha: 1 }. For OKLCH, alpha is
optional, lightness uses the 0–1 scale, and hue is in degrees.
Other color fields take references such as slate-700, black, or white.
black and white are built in. Raw hex strings are not valid references.
idstring
Swatch identifier, unique within swatches.
stringnamestring
Visible color name.
stringcolorColorReference
Palette reference or black/white.
ColorReferencecmyk?[number, number, number, number]
Authored print specification.
[number, number, number, number]pantone?string
Print reference label.
stringusage?string
Short usage guidance.
stringcategory?"primary" | "secondary"
Color category.
"primary" | "secondary"span?1 | 2
Horizontal swatch span.
1 | 2rows?1 | 2
Vertical swatch span.
1 | 2on?ColorReference
Explicit swatch foreground.
ColorReferenceThe table describes an entry in brand.colors.swatches. See Colors
for a complete palette example.
Light and dark themes
brand.theme.default is "light", "dark", or "system". Both light and
dark require all of the following roles, each a color reference:
| Group | Required roles |
|---|---|
| Page | background, foreground |
| Cards | card, cardForeground |
| Popovers | popover, popoverForeground |
| Main actions | primary, primaryForeground |
| Supporting surfaces | secondary, secondaryForeground, muted, mutedForeground |
| Accent | accent, accentForeground |
| Destructive actions | destructive, destructiveForeground |
| Controls | border, input, ring |
| Charts | chart1, chart2, chart3, chart4, chart5 |
| Sidebar | sidebar, sidebarForeground, sidebarPrimary, sidebarPrimaryForeground, sidebarAccent, sidebarAccentForeground, sidebarBorder, sidebarRing |
See Themes for how roles map to CSS variables and how to review both schemes without relying on JavaScript.
Typography specifications
brand.typography requires the CSS font-family stacks display, text, and
mono, plus families, weights, and scale arrays.
- Family entries require
id("display","text", or"mono") andname. Optional fields:foundry,url,note. - Weight entries require
nameand numericweight. Optional:italic. Weight numbers must be unique, including entries marked italic. - Scale entries follow the table below.
idstring
Stable style identifier, unique within scale.
stringnamestring
Visible style name.
stringsizestring
CSS font size, including responsive clamp expressions.
stringlineHeightstring
CSS line-height value.
stringtrackingstring
CSS letter-spacing value.
stringfont?"display" | "text"
Typography role.
"display" | "text"weight?number
Font weight.
numberrole?string
Short usage explanation.
stringsample?string
Specimen text.
stringtransform?"none" | "uppercase" | "lowercase" | "capitalize"
Text transformation.
"none" | "uppercase" | "lowercase" | "capitalize"print?{ size: string; leading: string; tracking: string }
Print specification. All three fields are required when present; this does not generate a PDF.
{ size: string; leading: string; tracking: string }See Typography for a complete example.
Load fonts
Root-level fonts is an array; it is separate from brand.typography.
When omitted, it declares Inter from Google with "100 900" weights, normal and
italic styles, and system fallbacks. Supplying an array replaces that default.
namestring
Nonempty provider family name.
stringcssVariablestring
Unique CSS variable matching -- followed by a letter or underscore, then letters, numbers, underscores, or hyphens.
stringprovider"google" | "fontsource" | "bunny" | "fontshare" | "adobe" | "local"
Serializable Astro font-provider declaration.
"google" | "fontsource" | "bunny" | "fontshare" | "adobe" | "local"id?string
Required nonempty Adobe project ID when provider is adobe; unsupported for other providers.
stringoptions?{ variants: FontVariant[] }
Required for local fonts. Nonempty variants; each needs a nonempty src array relative to the client project root.
{ variants: FontVariant[] }weights?(number | string)[]
Nonempty list; variable ranges use a string such as 100 900.
(number | string)[]styles?("normal" | "italic" | "oblique")[]
Nonempty style list.
("normal" | "italic" | "oblique")[]subsets?string[]
Nonempty provider subset list.
string[]formats?("woff2" | "woff" | "ttf" | "otf" | "eot")[]
Nonempty format list.
("woff2" | "woff" | "ttf" | "otf" | "eot")[]fallbacks?string[]
CSS fallback family names.
string[]optimizedFallbacks?boolean
Whether to optimize fallback metrics.
booleandisplay?"auto" | "block" | "swap" | "fallback" | "optional"
Font-display policy.
"auto" | "block" | "swap" | "fallback" | "optional"stretch?string
CSS stretch value.
stringfeatureSettings?string
CSS feature settings.
stringvariationSettings?string
CSS variation settings.
stringunicodeRange?string[]
Nonempty CSS unicode-range list.
string[]Local variants accept optional weight and style, plus display, stretch,
featureSettings, variationSettings, and unicodeRange. See Fonts
for hosted and local examples and warning behavior.
Logo specifications
brand.logo requires logotype, brandmark, clearspace, minSize, and
colorways. Optional fields are favicon and pronunciation.
| Object | Required fields | Optional fields |
|---|---|---|
logotype, brandmark |
onLight, onDark (file paths); aspect (numeric width / height) |
altText |
clearspace |
unit (description), ratio (number) |
— |
minSize |
digital, print (descriptive strings) |
— |
Each colorways entry |
Unique id, fg, bg (color references) |
label |
The generated site otherwise references /favicon.svg. Keep the preferred
colorway first. See Logos for an example with artwork paths.
Contact and downloads
brand.contact is required, but {} is allowed. Its optional fields are
email, website, phone, address (string array), and socials.
Each social entry requires a unique id plus label, handle, and url.
See Contact and social profiles.
brand.downloads is optional. Entries require unique id, label, and href;
format, size, and note are optional display strings. Brandtree does not
create archives or calculate file sizes. See Brand assets.
Localized brand copy
brand.localeOverrides is an optional record keyed by locale code. It requires
root i18n, and each key must be configured in i18n.locales.
Supported overrides are reader-facing metadata, palette names, swatch names and
usage, typography stacks and labels, logo text, address lines, social labels,
and download labels and notes. Array entries match canonical id values;
weight entries match their numeric weight. Unknown and duplicate identifiers
are invalid. Artwork paths, colors, URLs, measurements, and theme roles stay
canonical. See Localization for the complete workflow.
Social preview settings
seo.og accepts the following fields:
enabled?boolean
Generate per-page social cards. Explicit page SEO images still work when disabled.
booleantruelogo?string | false
Local SVG override; false hides the logo.
string | falseeyebrow?string | false
Label above the headline; defaults to the localized site title.
string | falsedescription?string | false
Subtitle; defaults to the site description.
string | falsesite?string | false
Footer site text; false hides it.
string | falsepalette?{ accent?: string; background?: string; border?: string; foreground?: string; muted?: string }
Actual CSS colors, unlike brand color-reference fields.
{ accent?: string; background?: string; border?: string; foreground?: string; muted?: string }titles?Record<string, string>
Card headlines for custom route paths. Content pages use their page title.
Record<string, string>See Social cards and SEO for generation and page-level overrides.
Check your changes
Config validation checks unknown fields, duplicate IDs and weights, complete schemes, color references, font variables, and locale references. It also reports local asset warnings. See Validation for the checking workflow. Visual review still matters for contrast, artwork, and typography.