Bootstrap Placeholders - Bootstrap 5 Placeholder Component
Bootstrap Placeholders
- Placeholders can be used to enhance the experience of your application. They are built only with HTML and CSS, meaning you don’t need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility.
- Their appearance, color, and sizing can be easily customized with our utility classes.
- 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.
Sample Code
Output
Bootstrap Placeholders Example
- Create placeholders with the .placeholder class and a grid column class to set the width. They can replace the text inside an element or be added as a modifier class to an existing component.
Sample Code
Output
Bootstrap Placeholders Width
- Change the width through grid column classes, width utilities, or inline styles.
Sample Code
Output
Bootstrap Placeholders Color
- The placeholder uses currentColor. This can be overridden with a custom color or utility class.
Sample Code
Output
Bootstrap Placeholders Sizing
- 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.
Sample Code
Output
Bootstrap Placeholders Animation
- Animate placeholders with .placeholder-glow or .placeholder-wave to better convey the perception of something being actively loaded.