Components

MessageBox

<MessageBox />

Constructor

# <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 'admin-bro'

View Source admin-bro/src/frontend/components/design-system/molecules/message-box.tsx, line 123

Examples

Different variants

Different variants with children

Small with an icon and inside text

Type Definitions

object

# StyledMessageBoxProps

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 admin-bro/src/frontend/components/design-system/molecules/message-box.tsx, line 149