Fork me on GitHub
Attention: This component is still under progress and experimental.
b:messages The messages tag renders faces messages with the Boostrap alert style.
Tag attributes
                            <!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://xmlns.jcp.org/jsf/html" 
      xmlns:f="http://xmlns.jcp.org/jsf/core" 
      xmlns:b="http://butterfaces.org/components"> 
<h:head /> 
<body>
    <h:form>
        <b:messages globalOnly="false"
                    showDetail="false"
                    rendered="true" />

        <div class="btn-group">
            <b:commandLink value="add fatal message"
                           styleClass="btn btn-outline-secondary"
                           action="#{myBean.addFatalMessageToContext()}">
                <f:ajax execute="@this" render="@form"/>
            </b:commandLink>
        </div>
    </h:form>

</body> 
</html>
                        
                            package org.butterfaces.tree.demo;

import import javax.faces.application.FacesMessage;
import import javax.faces.context.FacesContext;
import import javax.faces.view.ViewScoped;
import import javax.inject.Named;

@ViewScoped
@Named
public class MyBean implements Serializable {

    public void addFatalMessageToContext() {
        final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_FATAL,
                                                  "summary text...",
                                                  "detail text...")
        FacesContext.getCurrentInstance().addMessage(null, facesMessage);
    }

}