Skip to content
Wicket Oat Demo
Theme: 💼 Business

Oat Alert Demo

Alerts provide contextual feedback messages for typical user actions. They use the role="alert" attribute and an optional data-variant attribute for styling.

Variants

This is a default alert message.
Success! Your operation was completed successfully.
Warning! There might be some issues with your input.
Error! Something went wrong while processing your request.

How to use

The OatAlert component is a container, while AlertBehavior can be added to any Wicket component.

// Java - The OatAlert component
add(new OatAlert("myAlert", OatVariant.SUCCESS));

// Java - AlertBehavior on any component
label.add(Oat.Behaviors.alert(OatVariant.SUCCESS));
<!-- HTML - Markup for the container approach -->
<div wicket:id="myAlert">
    Any markup here...
</div>

Live Example (Behavior on Label)

This is a Label with AlertBehavior attached.