Introduction
Callouts are used to draw attention to important information or messages. They are often used for alerts, notices, or tips. You can create a callout using theCallout component:
Using status variants
Callouts have built-in status variants that automatically set the appropriate icon, icon color, and background color. You can use thedanger(), info(), success(), or warning() methods:
Removing the background color
By default, status callouts have a colored background. You can remove the background color while keeping the status icon and icon color by usingcolor(null):
Adding a custom icon
You can add a custom icon to the callout using theicon() method:
Changing the icon color
You can change the icon color using theiconColor() method:
Changing the icon size
By default, the icon size is “large”. You can change it to “small” or “medium” using theiconSize() method:
Using a custom background color
You can set a custom background color using thecolor() method:
Adding actions to the callout footer
You can add actions to the callout footer using theactions() method:
Changing the footer actions alignment
By default, actions are aligned to the start. You can change the alignment using thefooterActionsAlignment() method:
Alignment::Start, Alignment::Center, Alignment::End, and Alignment::Between.
Adding custom footer content
You can add custom content to the footer using thefooter() method. This accepts an array of schema components:
Adding custom control content
You can add custom content to the controls (top-right corner) using thecontrols() method. This accepts an array of schema components:
Adding control actions to the callout
You can add control actions to the top-right corner of the callout using thecontrolActions() method. For example, you could add a dismiss button that hides the callout for the duration of the user’s session: