Alerts

Default Alert

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. Alerts are available for any length of text, as well as an optional dismiss button.

For proper styling, use one of the eight required contextual classes (e.g., .alert-success). For background color use class .bg-* , .text-white

                                                    
                                                        <div class="alert alert-primary" role="alert">
                                                            <strong>Primary - </strong> A simple primary alert—check it out!
                                                        </div>
                                                        <div class="alert alert-secondary" role="alert">
                                                            <strong>Secondary - </strong> A simple secondary alert—check it out!
                                                        </div>
                                                        <div class="alert alert-success" role="alert">
                                                            <strong>Success - </strong> A simple success alert—check it out!
                                                        </div>
                                                        <div class="alert alert-danger" role="alert">
                                                            <strong>Error - </strong> A simple danger alert—check it out!
                                                        </div>
                                                        <div class="alert alert-warning bg-warning text-white border-0" role="alert">
                                                            <strong>Warning - </strong> A simple warning alert—check it out!
                                                        </div>
                                                        <div class="alert alert-info bg-info text-white border-0" role="alert">
                                                            <strong>Info - </strong> A simple info alert—check it out!
                                                        </div>
                                                        <div class="alert alert-light bg-light text-dark border-0" role="alert">
                                                            <strong>Light - </strong> A simple light alert—check it out!
                                                        </div>
                                                        <div class="alert alert-dark bg-dark text-white border-0 mb-0" role="alert">
                                                            <strong>Dark - </strong> A simple dark alert—check it out!
                                                        </div> 
                                                    
                                                

Dismissing Alerts

Add a dismiss button and the .alert-dismissible class, which adds extra padding to the right of the alert and positions the .btn-close button.

                                                        
                                                            <div class="alert alert-primary alert-dismissible bg-primary text-white border-0 fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Primary - </strong> A simple primary alert—check it out!
                                                            </div>
                                                            <div class="alert alert-secondary alert-dismissible bg-secondary text-white border-0 fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Secondary - </strong> A simple secondary alert—check it out!
                                                            </div>
                                                            <div class="alert alert-success alert-dismissible bg-success text-white border-0 fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Success - </strong> A simple success alert—check it out!
                                                            </div>
                                                            <div class="alert alert-danger alert-dismissible bg-danger text-white border-0 fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Error - </strong> A simple danger alert—check it out!
                                                            </div>
                                                            <div class="alert alert-warning alert-dismissible fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Warning - </strong> A simple warning alert—check it out!
                                                            </div>
                                                            <div class="alert alert-info alert-dismissible fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Info - </strong> A simple info alert—check it out!
                                                            </div>
                                                            <div class="alert alert-light alert-dismissible fade show" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Light - </strong> A simple light alert—check it out!
                                                            </div>
                                                            <div class="alert alert-dark alert-dismissible fade show mb-0" role="alert">
                                                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                                                <strong>Dark - </strong> A simple dark alert—check it out!
                                                            </div>
                                                        
                                                    

Custom Alerts

Display alert with transparent background and with contextual text color. Use classes .bg-white, and .text-*. E.g. bg-white text-primary.

                                                        
                                                            <div class="alert alert-primary bg-white text-primary" role="alert">
                                                                This is a <strong>primary</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-secondary bg-white text-secondary" role="alert">
                                                                This is a <strong>secondary</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-success bg-white text-success" role="alert">
                                                                This is a <strong>success</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-info bg-white text-info" role="alert">
                                                                This is a <strong>info</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-warning bg-white text-warning" role="alert">
                                                                This is a <strong>warning</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-danger bg-white text-danger" role="alert">
                                                                This is a <strong>danger</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-light bg-white text-light" role="alert">
                                                                This is a <strong>light</strong> alert—check it out!
                                                            </div>
                                                            <div class="alert alert-dark bg-white text-dark" role="alert">
                                                                This is a <strong>dark</strong> alert—check it out!
                                                            </div>
                                                        
                                                    

Link Color

Use the .alert-link utility class to quickly provide matching colored links within any alert.

Icons with Alerts

You can also include additional elements like icons, heading, etc along side the actual message.

                                                        
                                                            <div class="alert alert-success" role="alert">
                                                                <i class="dripicons-checkmark me-2"></i> This is a <strong>success</strong> alert - check it out!
                                                            </div>
                                                            <div class="alert alert-danger" role="alert">
                                                                <i class="dripicons-wrong me-2"></i> This is a <strong>danger</strong> alert - check it out!
                                                            </div>
                                                            <div class="alert alert-warning" role="alert">
                                                                <i class="dripicons-warning me-2"></i> This is a <strong>warning</strong> alert - check it out!
                                                            </div>
                                                            <div class="alert alert-info" role="alert">
                                                                <i class="dripicons-information me-2"></i> This is a <strong>info</strong> alert - check it out!
                                                            </div>
                                                        
                                                    

Additional content

Alerts can also contain additional HTML elements like headings, paragraphs and dividers.

                                                        
                                                            <div class="alert alert-success" role="alert">
                                                                <h4 class="alert-heading">Well done!</h4>
                                                                <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
                                                                <hr>
                                                                <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
                                                            </div>
                                                        
                                                    
Settings
Color Scheme

Width

Left Sidebar

Purchase Now