Configuration
Use a Format studio config file to control the core behavior of Studio.
Name your config file format.config.json and place it in the root of your repo or package, next to the package.json. You can also use the .jsonc extension.
The $schema field gives you autocomplete and validation in your editor.
{
"$schema": "https://format.dev/schema/format-config.json",
"version": "0.1.2",
"framework": "react",
"sharedAssetsDir": "./assets"
}Reference
| Name | Description |
|---|---|
versionRequired | The Format release version this project is pinned to. Every installed Format
package is kept in lockstep with this version. Set it to the version you
want and run format update to apply it everywhere. Must be an exact
version, never a range. |
frameworkRequired | Which framework to use for your Format documents. |
| Path or URL to the JSON schema for this file, used by editors for autocomplete and validation. Set it to: https://format.dev/schema/format-config.json. | |
| The root directory where all Format code is located, relative to the config file. Change this if you want to root your Format documents and data under a different directory. For example, setting this to "format" would result in your documents being located in "format/documents". | |
The directory for assets shared across documents, as a relative path. Defaults to assets under the root dir, mirroring each document's own ./assets/ folder. In your template code, this resolves as "./": place image.png in this directory and reference it as "./image.png". Somewhat equivalent to a public dir in a Vite project. | |
Override the base path resolution for Format. Useful if you want to have your config in a different directory to the root of your project. For example, if you put your format.config.json file in a config directory, you could set cwd to ../ to tell Format to look for your project in the parent directory. | |
Specify a path to a .env file. If path is relative, this is resolved relative to cwd. | |
Panda CSS configuration options. The PandaCssPostCssPluginOptions type is exposed as PluginOptions from the @pandacss/dev/postcss package. Useful resource: https://github.com/chakra-ui/panda/blob/main/packages/postcss/src/index.ts |
Details
version
RequiredDescription
The Format release version this project is pinned to. Every installed Format package is kept in lockstep with this version. Set it to the version you want and run
format update to apply it everywhere. Must be an exact version, never a range.Type
stringExample
"0.1.2"framework
RequiredDescription
Which framework to use for your Format documents.
Type
"react" | "vue" | "html"$schema
Description
Path or URL to the JSON schema for this file, used by editors for autocomplete and validation. Set it to: https://format.dev/schema/format-config.json.
Type
stringExample
"https://format.dev/schema/format-config.json"rootDir
Description
The root directory where all Format code is located, relative to the config file. Change this if you want to root your Format documents and data under a different directory. For example, setting this to "format" would result in your documents being located in "format/documents".
Type
stringDefault value
"./"Example
"format"cwd
Description
Override the base path resolution for Format. Useful if you want to have your config in a different directory to the root of your project. For example, if you put your
format.config.json file in a config directory, you could set cwd to ../ to tell Format to look for your project in the parent directory.Type
stringDefault value
process.cwd()Example
"../"dotEnvPath
Description
Specify a path to a
.env file. If path is relative, this is resolved relative to cwd.Type
stringDefault value
resolve(cwd, .env)Example
"../../.env"pandaCss
Description
Panda CSS configuration options. The
PandaCssPostCssPluginOptions type is exposed as PluginOptions from the @pandacss/dev/postcss package. Useful resource: https://github.com/chakra-ui/panda/blob/main/packages/postcss/src/index.tsType
{ enabled: boolean, postCssConfig: PandaCssPostCssPluginOptions }Default value
{
enabled: false,
postCssConfig: {
cwd: rootDir || "./",
configPath: resolve(rootDir || "./", "panda.config.ts")
}
}Was this page helpful?