Concepts
OverviewCompositionTestingLayout
Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrapComponents
AccordionAdmonitionAvatarButtonCheckboxComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsProgressPrompt ModalRadioRatingSelectSwitchTableTabsTagTextTextareaToggleTooltipUtilities
Feature FlagsForLocal StoragePortalShowsplitPropsThemeUsage
1import { Theme } from "@cerberus/react"
1<Theme mode="dark">2 This is dark mode3</Theme>
Examples
Basic
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.
Good to know: We use native panda-css attributes to achieve this.
Portalled
Use the asChild
prop to force the appearance of portalled elements like the
popover and modal content.
1import { TooltipParts, Theme } from '@cerberus/react'2
3function PortalledExample() {4 return (5 <TooltipParts.Root>6 <TooltipParts.Trigger asChild>7 <Button>Dark</Button>8 </TooltipParts.Trigger>9
10 <TooltipParts.Positioner>11 <TooltipParts.Content asChild>12 <Theme mode="dark">13 <Button>Dark</Button>14 </Theme>15 </TooltipParts.Content>16 </TooltipParts.Positioner>17 </TooltipParts.Root>18 )19}
Page Specific Color Mode
To lock a page to a specific color mode (light or dark), wrap the entire page
with the Theme
component.
1import { Theme } from "@cerberus/react"2
3export default Page = ({ children }) => {4 return (5 <Theme mode="dark">{/* Rest of the page */}</Theme>6 )7}
On this page