Placeholders

Examples

Use loading placeholders for your components or pages to indicate something may still be loading.

Placeholders on Bootstrap

Placeholders

                                    
                                        <!-- card-img-top -->
                                        <img src="assets/images/stock/small-1.jpg" class="card-img-top" alt="...">

                                        <div class="card-body">
                                            <h5 class="card-title mb-2">Card title</h5>
                                            <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's
                                                content.</p>
                                            <a href="#" class="btn btn-primary">Go somewhere</a>
                                        </div> <!-- end card-body-->

                                        <div class="card border shadow-none mb-0" aria-hidden="true">
                                            <svg class="card-img-top" width="100%" style="aspect-ratio: 16 / 10;" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder" preserveAspectRatio="xMidYMid slice" viewBox="0 0 16 10">
                                                <title>Placeholder</title>
                                                <rect width="16" height="10" fill="#20c997"></rect>
                                            </svg>

                                            <div class="card-body">
                                                <h5 class="card-title placeholder-glow">
                                                    <span class="placeholder col-6"></span>
                                                </h5>
                                                <p class="card-text placeholder-glow">
                                                    <span class="placeholder col-7"></span>
                                                    <span class="placeholder col-4"></span>
                                                    <span class="placeholder col-4"></span>
                                                    <span class="placeholder col-6"></span>
                                                </p>
                                                <a class="btn btn-primary disabled placeholder col-6" aria-disabled="true"> <span class="invisible">Read Only</span></a>
                                            </div> <!-- end card-body-->
                                        </div> <!-- end card-->
                                    
                                

In the example below, we take a typical card component and recreate it with placeholders applied to create a “loading card”. Size and proportions are the same between the two.

...
Card Title

Some quick example text to build on the card title and make up the bulk of the card's content.

Go somewhere

Color

                                    
                                        <span class="placeholder col-12"></span>
                                        <span class="placeholder col-12 bg-primary"></span>
                                        <span class="placeholder col-12 bg-secondary"></span>
                                        <span class="placeholder col-12 bg-success"></span>
                                        <span class="placeholder col-12 bg-danger"></span>
                                        <span class="placeholder col-12 bg-warning"></span>
                                        <span class="placeholder col-12 bg-info"></span>
                                        <span class="placeholder col-12 bg-light"></span>
                                        <span class="placeholder col-12 bg-dark"></span>
                                    
                                

By default, the placeholder uses currentColor. This can be overriden with a custom color or utility class.

Width

                                    
                                        <span class="placeholder col-6"></span>
                                        <span class="placeholder w-75"></span>
                                        <span class="placeholder" style="width: 25%;"></span> <br />
                                        <span class="placeholder" style="width: 10%;"></span>
                                    
                                

You can change the width through grid column classes, width utilities, or inline styles.

Sizing

                                    
                                        <span class="placeholder col-12 placeholder-lg"></span>
                                        <span class="placeholder col-12"></span>
                                        <span class="placeholder col-12 placeholder-sm"></span>
                                        <span class="placeholder col-12 placeholder-xs"></span>
                                    
                                

The size of .placeholders are based on the typographic style of the parent element. Customize them with sizing modifiers: .placeholder-lg, .placeholder-sm, or .placeholder-xs.

How it works

                                    
                                        <p aria-hidden="true">
                                            <span class="placeholder col-6"></span>
                                        </p>

                                        <a href="#" class="btn btn-primary disabled placeholder col-4" aria-hidden="true"></a>
                                    
                                

Create placeholders with the .placeholder class and a grid column class (e.g., .col-6) to set the width. They can replace the text inside an element or as be added as a modifier class to an existing component.

Animation

                                    
                                        <p class="placeholder-glow">
                                            <span class="placeholder col-12"></span>
                                        </p>
                                 
                                        <p class="placeholder-wave mb-0">
                                            <span class="placeholder col-12"></span>
                                        </p>
                                    
                                

Animate placehodlers with .placeholder-glow or .placeholder-wave to better convey the perception of something being actively loaded.

© 2014 - Inspinia By WebAppLayers
10GB of 250GB Free.
Admin Customizer

Easily configure layout, styles, and preferences for your admin interface.

Select Theme
Classic
Material
Modern
SaaS
Flat
Minimal
Galaxy
Color Scheme
Light
Dark
System
Topbar Color
Light
Dark
Gray
Gradient
Sidenav Color
Light
Dark
Gray
Gradient
Image
Sidebar Size
Default
Compact
Condensed
On Hover
On Hover - Show
Offcanvas
Layout Position