DocsBlog
  • 0.25.3

  • light

    dark

    system

    Switch mode
  • Cerberus

    Acheron

    Elysium

Get Started
Components
Styling
Theming

Concepts

OverviewCompositionTesting

Layout

Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFrameHighlightJSON Tree ViewLocaleLocal StoragePortalPresenceShowsplitPropsTheme

Admonition

An abstracted informational component that can be used to display important messages or warnings to users.

  • npm
  • source
  • recipe
import { Admonition } from '@cerberus/react'

Usage

The Admonition component is an abstracted informational component that can be used to display important messages or warnings to users. It can be used in various contexts, such as error, success, or informational messages.

Note

This is a page admonition that is commonly use to display a page-level informational messages.

Copy
admonition.tsx
import { Admonition } from '@cerberus/react'
import { Box } from 'styled-system/jsx'
function UsageDemo() {
return (
<Box w="1/2">
<Admonition heading="Note">
This is a page admonition that is commonly use to display a page-level
informational messages.
</Admonition>
</Box>
)
}

Palette

The Admonition component can be customized with different color palettes to match the design of your application. You can use: info, action, or any of the state-related palettes.

Account Error

There is an error with your account. Please contact support within the next 7 days to keep access.

Copy
palette.tsx
function PaletteDemo() {
return (
<Box w="1/2">
<Admonition heading="Account Error" palette="danger">
There is an error with your account. Please contact support within the
next 7 days to keep access.
</Admonition>
</Box>
)
}

Usage

The Admonition component can be used to display different styles of messages, such as filled (default) or outlined.

Note

This is a page admonition that is commonly use to display a page-level informational messages.

Copy
admonition.tsx
function UsageDemo() {
return (
<Box w="1/2">
<Admonition heading="Note" usage="outlined">
This is a page admonition that is commonly use to display a page-level
informational messages.
</Admonition>
</Box>
)
}

Primitives

You can utilize the primitive components or the css prop to customize the admonition. Each part forwards ref and allows for a asChild prop.

ComponentDescription
AdmonitionRootThe container for the parts
AdmonitionIndicatorThe icon of the admonition
AdmonitionContentThe content container of the admonition
AdmonitionHeadingThe heading of the admonition
AdmonitionDescriptionThe description body of the admonition

Cerberus Forever

President's are temporary, but Cerberus is forever.

Copy
Custom demo
import { AdmonitionParts } from '@cerberus/react'
export function CustomDemo() {
return (
<Box w="1/2">
<AdmonitionParts.Root
css={{
transform: 'skewX(-10deg)',
}}
>
<AdmonitionParts.Indicator>
<Circle size="6">
<PawIcon />
</Circle>
</AdmonitionParts.Indicator>
<AdmonitionParts.Content>
<AdmonitionParts.Heading
css={{
color: 'danger.text.initial',
textTransform: 'uppercase',
}}
>
Cerberus Forever
</AdmonitionParts.Heading>
<AdmonitionParts.Description>
President&apos;s are temporary, but Cerberus is forever.
</AdmonitionParts.Description>
</AdmonitionParts.Content>
</AdmonitionParts.Root>
</Box>
)
}

API

Props

The Admonition component is an abstraction of the primitives and accepts the following props:

NameDefaultDescription
headingThe heading title of the Admonition.
iconAn alternative icon to display in the Admonition.
palettepageThe color palette of the Admonition.
usagefilledThe usage of the Admonition. Can be filled or outlined.

Parts

The AdmonitionParts API is an Object containing the full family of components.

Note

It is best to only use the AdmonitionParts if you are building a custom solution. Importing Object based components will ship every property it includes into your bundle, regardless if you use it or not.

NameDescription
RootThe AdmonitionRoot component which is the container of the family.
IndicatorThe AdmonitionIndicator component which is the icon of the admonition
ContentThe AdmonitionContent component which is the container of the admonition
HeadingThe AdmonitionHeading component which is the heading of the admonition
DescriptionThe Admonition component which is the description body of the admonition

The Parts additionally use the following data attributes:

NameValueDescription
data-scopeadmonitionThe scope of the components.
data-partroot, indicator, content, heading, descriptionThe part of the component.

On this page

  • Edit this page on Github
Cerberus Design System | Docs