Want to skip the docs? Check out pandamastery.com - the best way to learn Panda CSS

design systems
minimal setup

Minimal Setup

How to set up Panda with the bare minimum.

The default Panda setup includes utilities and design tokens by default. In this guide, you'll see how to strip out the defaults and start from scratch.

Removing default tokens

To remove the default design tokens injected by Panda, set the presets key to an empty array:

export default defineConfig({
  // ...
  presets: []
})

This allows you to define your own tokens, without having to use the extend key in the theme.

export default defineConfig({
  // ...
  theme: {
    tokens: {
      colors: {
        primary: { value: '#ff0000' }
      }
    }
  }
})

Removing default utilities

The default utilities come from @pandacss/preset-base. To remove them, omit @pandacss/preset-base from presets (or use presets: []) — Panda doesn't add it for you.

Panda doesn't automatically know which tokens are valid for which CSS properties, so it is necessary to tell Panda that my tokens from the "colors" category are valid for the CSS property "color".

export default defineConfig({
  // ...
  presets: [],
  utilities: {
    color: {
      values: 'colors'
    }
  },
  theme: {
    tokens: {
      colors: {
        primary: { value: '#ff0000' }
      }
    }
  }
})

This makes <p className={css({ color: 'primary' })}> Text </p> work as expected.

Re-using Panda presets

Panda offers 2 presets:

  • @pandacss/preset-base: This is a relatively unopinionated set of utilities for mapping CSS properties to values (almost everyone will want these)

You can use these presets by installing them via npm and adding them to your presets key:

export default defineConfig({
  // ...
  presets: ['@pandacss/preset-base']
})
  • @pandacss/preset-panda as an opinionated set of tokens if you don't want to define your own colors/spacing/fonts etc.
export default defineConfig({
  // ...
  presets: ['@pandacss/preset-panda']
})
💡

Note: Panda doesn't add @pandacss/preset-base or @pandacss/preset-panda for you. Install the ones you want and list them in presets.