DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Cerberus Context

Register custom options for interal component usage.

  • npm
  • source
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { CerberusProvider, makeSystemConfig, defineIcons } from '@cerberus/react'

Usage

The Cerberus Context provides the ability to register custom options for internal component usage.

'use client'
 
import { CerberusProvider } from '@cerberus-design/react'
import { type PropsWithChildren } from 'react'
 
export function CerberusConfig(props: PropsWithChildren) {
  return <CerberusProvider>{props.children}</CerberusProvider>
}

Config

The Cerberus Context configuration is passed to the config property of the CerberusProvider via the makeSystemConfig helper.

'use client'
 
import { CerberusProvider, makeSystemConfig } from '@cerberus-design/react'
import { PropsWithChildren } from 'react'
 
const config = makeSystemConfig()
 
export function ConfigDemo(props: PropsWithChildren) {
  return <CerberusProvider config={config}>{props.children}</CerberusProvider>
}

Registering Custom Icons

To register a different set of icons for your application, you can use the defineIcons function and pass it to the icons prop of the CerberusProvider config property.

'use client'
 
import { CerberusProvider, defineIcons, makeSystemConfig } from '@cerberus-design/react'
import { ChevronDown } from '@carbon/icons-react'
import type { PropsWithChildren } from 'react'
 
const icons = defineIcons({
  // Add a different icon for the accordion indicator
  accordionIndicator: ChevronDown,
})
 
const config = makeSystemConfig({
  icons,
})
 
export default function CerberusConfig(props: PropsWithChildren<{}>) {
  return <CerberusProvider config={config}>{props.children}</CerberusProvider>
}

Icon overrides

Here is the exhaustive list of icon overrides you can configure:

NameDescription
accordionIndicatorThe arrow indicator used in accordion components.
arrowRightThe arrow indicator used for representing moving forward.
avatarThe fallback icon used when no avatar is available.
calendarThe calendar icon used in date picker components.
calendarPrevThe prev month trigger icon used in date picker components.
calendarNextThe next month trigger icon used in date picker components.
caretDownThe caret down icon used in dropdown components.
checkboxThe checkbox icon used in checkbox components.
closeThe close icon used in closeable components.
columnThe column icon used in column-related components.
confirmModalThe header icon used in confirm modals.
decrementThe icon used for decrement triggers.
deleteThe icon used for delete triggers.
dangerNotificationThe icon used for danger notifications.
errorThe icon used for error notifications.
fileUploaderThe icon used for file uploader components.
filterThe icons used to represent filtering things.
filterEditThe icons used to represent editing filtered things.
filterClearThe icons used to represent clearing filters.
indeterminateThe icon used for indeterminate states.
incrementThe icon used for increment triggers.
infoThe icon used for info triggers.
infoNotificationThe icon used for info notifications.
invalidThe icon used for invalid states.
invalidAltThe icon used for alternative invalid states.
moreVerticalThe icon used for more options triggers.
pinLeftThe icon used for pin left triggers.
pinLeftFilledThe icon used for pin left triggers with a filled style.
pinRightThe icon used for pin right triggers.
pinRightFilledThe icon used for pin right triggers with a filled style.
promptModalThe icon used for prompt modal triggers.
redoThe icon used for redo triggers.
searchThe icon used for search triggers.
selectArrowThe icon used for select menu triggers.
selectCheckedThe icon used for the checked state of a select menu item.
sortAscThe icon used for ascending sort triggers.
sortDescThe icon used for descending sort triggers.
successThe icon used for success triggers.
successNotificationThe icon used for success notifications.
tableAn icon used to represent tables.
toggleCheckedThe icon used for toggle checked triggers.
viewOffThe icon used for view off triggers (e.g., hide items, password visibility, etc.)
waitingFileUploaderThe icon used for a loading state in the File Uploader.
warningNotificationThe icon used for warning notifications.
warningThe icon used for warning triggers.

Config Options

NameDescription
iconsCustom icons to register for all component usage.

On this page

  • Import
  • Usage
  • Config
  • Registering Custom Icons
    • Icon overrides
  • Config Options
Edit this page on Github