Customization Learn how to customize Cerberus to suit your needs.
Cerberus is a highly customizable tool that allows you to define your own rules and configurations. This page will guide you through the process of customizing Cerberus to suit your needs.
Use global config when: Create your own design system Make global changes to Cerberus settings Add custom additions to Cerberus
Use component level when: Create one-off component style changes Build your own custom components
For large projects, you may want to define a global configuration file that applies to Cerberus as a whole by extending the preset.
We recommend creating a theme
directory and adding a config.ts
file to it. This file will contain your custom theme configuration.
import { defineTheme } from ' @cerberus/panda-preset '
import { semanticTokens } from ' ./semantic-tokens/config '
import { keyframes } from ' ./keyframes '
import { recipes , slotRecipes } from ' ./recipes '
import { textStyles } from ' ./textStyles '
import { tokens } from ' ./tokens '
* This module contains our custom theme to use with Cerberus.
export const yourCustomTheme = defineTheme ( {
Create an entry file in the theme
directory that exports your custom theme as a new preset.
import { definePreset } from ' @pandacss/dev '
import { yourCustomTheme } from ' ./config '
* This module contains our custom preset which registers our custom theme.
export const yourCustomPreset = definePreset ( {
// register your custom theme
yourCustomThemeName : yourCustomTheme ,
// opt-into your theme to be used in static css generation
themes : [ ' yourCustomThemeName ' ] ,
To use your custom theme, you need to tell Panda it exists.
import { defineConfig } from ' @pandacss/dev '
import pandaPreset from ' @pandacss/preset-panda '
import { cerberusPreset , cerberusConfig } from ' @cerberus/panda-preset '
export default defineConfig ({
' ./node_modules/@cerberus/react/src/**/*.{ts,tsx} ' ,
' ./app/**/*.{ts,tsx,js,jsx} ' , // <- Make sure this path is to your project
presets : [pandaPreset , cerberusPreset , yourCustomPreset] ,
Finally, delcare your theme in your entry file.
Note
Be sure you run the `prepare` command to generate your theme into the Panda CSS static files.
import { cx } from ' @cerberus/styled-system/css '
import { Poppins , Recursive } from ' next/font/google '
import { type PropsWithChildren } from ' react '
const poppins = Poppins ( {
weight : [ ' 400 ' , ' 600 ' , ' 700 ' ] ,
variable : ' --font-poppins ' ,
const recursive = Recursive ( {
variable : ' --font-recursive ' ,
export default async function RootLayout ( props : PropsWithChildren < RootProps > ) {
data-panda-theme = " yourCustomThemeName "
className = { cx ( poppins . variable , recursive . variable ) }
This is the easiest way to customize Cerberus. You simply just add custom styles to a component in Cerberus.
Note
Most components in Cerberus support custom styles. More complex components (i.e. components that use slot recipes) will require the Global Configuration option.
import { Button , type ButtonProps } from ' @cerberus/react '
import { css } from ' @cerberus/styled-system '
export function CustomButton ( props : ButtonProps ) {
Some components in Cerberus use icons. You can customize these icons by providing your own icon components.
In your entry file, call defineIcons
with an object that maps icon names to icon components.
The following code replaces all instances of the invalid
icon with a custom Lucide icon.
import { defineIcons } from ' @cerberus/react '
import { cx } from ' @cerberus/styled-system/css '
import { Poppins , Recursive } from ' next/font/google '
import { type PropsWithChildren } from ' react '
import { CircleAlert } from ' lucide-react ' ;
const poppins = Poppins ( {
weight : [ ' 400 ' , ' 600 ' , ' 700 ' ] ,
variable : ' --font-poppins ' ,
const recursive = Recursive ( {
variable : ' --font-recursive ' ,
export default async function RootLayout ( props : PropsWithChildren < RootProps > ) {
className = { cx ( poppins . variable , recursive . variable ) }
data-panda-theme = " cerberus "
The defineIcons
function takes an object that maps icon names to icon components.
export type IconType = CarbonIconType | ElementType
export interface DefinedIcons {
infoNotification ? : IconType
successNotification ? : IconType
warningNotification ? : IconType
dangerNotification ? : IconType