Components

MessageBox

<MessageBox />

Component responsible for rendering standard danger/info/success messages.

It has 2 size versions: default and small. Also it can either contain or don't contain children, which causes different look.

Usage

import { MessageBox, MessageBoxProps } from '@adminjs/design-system'
See:

View Source adminjs-design-system/src/molecules/message-box.tsx, line 132

Examples

Different variants

Different variants with children

Small with an icon and inside text

Type Definitions

object

# MessageBoxProps

Prop Types of a MessageBox component.

Apart from those defined below it extends all SpaceProps

Properties:
Name Type Attributes Description
onCloseClick function <optional>

Triggered when user clicks close button. If not given close button won't be seen

message string <optional>

Title content of a message

variant 'danger' | 'info' | 'success' <optional>

Variant

icon string <optional>

Icon which will be seen in the title

size 'sm' <optional>

Size variant

style Record.<string, string> <optional>

Optional html style property

children React.ReactNode <optional>

Optional children, when given component will be expanded

View Source adminjs-design-system/src/molecules/message-box.tsx, line 159