Configuration
Where systhema.config lives, how it is loaded, and what each section controls.
On this page
systhema.config.ts is the one place a project configures Systhema: which tokens to read, how sizes become CSS, which component CSS to emit, and which packages and features are on. This page explains how the file is found and read; every key is listed in the systhema.config reference.
A typical configLink to this section
import type { SysthemaConfig } from '@systhemaui/core'
import manifest from './src/tokens/manifest.json'
const config: SysthemaConfig = {
manifest,
packages: {
react: {
enabled: true,
transitionClasses: 'duration-300 ease-out-cubic',
animationClasses: 'aos animate-fadeinup',
},
},
}
export default configEvery key is optional. Without a config file, or without a manifest, Systhema uses the default tokens that ship with @systhemaui/core.
In an HTML project without TypeScript, write the same object in systhema.config.js:
const manifest = require('./src/tokens/manifest.json')
/** @type {import('@systhemaui/core').SysthemaConfig} */
module.exports = {
manifest,
packages: { react: false },
}Where the config is loaded fromLink to this section
@systhemaui/core uses the first file it finds, in this order:
systhema.config.tssysthema.config.jssysthema.config.jsonsrc/systhema.config.tssrc/systhema.config.jssrc/systhema.config.json
How it is readLink to this section
- Merged with defaults. Your object is deep-merged over Systhema's default config, so you set only what differs.
manifestis the exception: when you set one, it replaces the default manifest instead of merging with it. - At build time. The Tailwind plugin and
systhema-core syncread the config to generate CSS, types and references. After changingmanifest,customTokens,spacingorblocks, runpnpm syncand restart the dev server. - On the server. Components and your server code read it through
getSysthemaConfigSync()orgetSysthemaConfig(). - In the browser. The config file is never bundled.
SysthemaProviderhands the browser the config together with a small snapshot of resolved token values, and client components read them from@systhemaui/core/client. See Client and server code.
What each section controlsLink to this section
| Key | Controls | Explained on |
|---|---|---|
manifest | Which token files are processed | Token collections |
customTokens | Token overrides and extensions | Custom tokens |
spacing | How sizing tokens become CSS (fixed or fluid) | Responsive sizing |
blocks | Which component CSS families are emitted | Component CSS blocks |
parallax | Parallax ranges | Parallax |
packages | Which integrations are on, and the classes React components add | systhema.config reference |
optimization | Production CSS passes and obfuscation | Production CSS optimization |
cookieConsent | The cookie consent banner (off by default) | Consent configuration |
locales | Frontend locales | Frontend locales |
messages | Frontend message catalogs | Messages |
packagesLink to this section
packages turns on the integrations a project uses. Both are off by default:
react:true, or an object withenabled,transitionClassesandanimationClasses. Turning it on adds the component classes to the safelist so Tailwind keeps them.transitionClassesgo on interactive elements (buttons, links, cards) andanimationClasseson elements that reveal as they scroll in; see Motion.payload:truein a Payload project. Payload itself is configured withwithSysthema()inpayload.config.ts; see withSysthema.
The package flags should match the @systhemaui/* packages in package.json. See Choosing packages.
Reading the config at runtimeLink to this section
Use getSysthemaConfigSync() or the async getSysthemaConfig() to read the merged config from your own server code, and import them from @systhemaui/core/client in a client component. See Runtime config.
import { getSysthemaConfigSync } from '@systhemaui/core'
const { packages } = getSysthemaConfigSync()