Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Banner

The Banner component displays a short message that needs more emphasis than surrounding content. Use its type to communicate the purpose of the message.

Import

1
import { Banner } from '@payloadcms/ui'

Basic usage

Loading component example…

Types

Use success to confirm an action, error when something failed, warning to flag a risk, and info for additional context. Use the default type for neutral messages.

Loading component example…

Keep banner copy concise and include the next action when the user must resolve something.

Common props

These are the props most commonly used with this component. See its exported types in @payloadcms/ui for the complete list.

Prop

Type

Default

Description

children

ReactNode

Message displayed inside the banner.

type

'default' | 'success' | 'error' | 'warning' | 'info'

'default'

Sets the message style.

icon

ReactNode

Displays an icon beside the message.

alignIcon

'left' | 'right'

'right'

Positions the icon.

onClick

(event: MouseEvent) => void

Makes the banner actionable.

to

string

Makes the banner navigate to the given URL.

Was this page helpful?

Next

Button