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

Theme

Used to force a part of the tree to a different mode or theme.

  • 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 { Theme } from '@cerberus/react'

Usage

Basic

Loading example...

Nested

The theme can be nested to apply different appearances to different parts of the tree. This is useful for applying a global appearance and then overriding some parts of it.

Note

Good to know: We use native panda-css attributes to achieve this.

Loading example...

Portalled

Use the asChild prop to force the appearance of portalled elements like the popover and modal content.

Loading example...

Page Specific Color Mode

To lock a page to a specific color mode (light or dark), wrap the entire page with the Theme component.

page.tsx
import { Theme } from '@cerberus/react'
 
export default (Page = ({ children }) => {
  return <Theme mode="dark">{/* Rest of the page */}</Theme>
})

API

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.
modeModesfalseundefinedThe mode to use for the scoped block.
themeThemesfalseundefinedThe theme to use for the scoped block.

On this page

  • Import
  • Usage
    • Basic
    • Nested
    • Portalled
    • Page Specific Color Mode
  • API
    • Props
Edit this page on Github
This is a dark mode tooltip bubble