Admonition

Page level informational messages

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.

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.

Usage

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

Primitives

You can utilize the primitive components 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

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.

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.