Day 5 in Bootstrap - Coding Ranjith



Badges and Labels


Badges and Labels

In Bootstrap 5.3, a badge is a small visual element used to highlight or indicate additional information within a user interface. Badges are typically used to display counts, notifications, status indicators, or labels. They are commonly seen in navigation menus, buttons, cards, and other UI components.

Bootstrap provides a built-in class called "badge" that can be applied to various HTML elements to create badges. By default, badges have a rounded shape and a background color that contrasts with the surrounding content. The text inside the badge is usually a number or a short label.

Here's an example of a basic badge in Bootstrap 5.3:

Heading Tags New

Heading Tags New

Heading Tags New

Heading Tags New

Heading Tags New
Heading Tags New

Buttons With Notification

To create badge buttons with notifications in Bootstrap 5.3, you can combine the button and badge components. Here's an example of how you can achieve this:

class="badge text-bg-secondary" this applies the Bootstrap classes "badge" and "text-bg-secondary" to the span element. The "badge" class styles the span element as a badge, and "text-bg-secondary" sets the text color to white and the background color to a secondary color (usually gray) for the badge.

So, the code creates a button with the text "Notification" and a badge indicating a count of 5. The badge has a gray background color and white text color. The button itself has a green color style applied to it. You can customize the classes, colors, and content according to your design needs.

Positioned Notification

To create a container <div> element with the class position-relative. This class allows the child elements to be positioned relative to this container.

Background colors

In Bootstrap 5.3, you can apply different background colors to badges using the contextual classes provided by the framework. These classes allow you to easily style badges with various background colors to convey different meanings or visual indicators.

Here are the available background color classes for badges in Bootstrap 5.3:

Badge Badge Badge Badge Badge Badge Badge Badge

Positioned Notification

In Bootstrap 5.3, pill badges are a variation of badges that have rounded corners, giving them a pill-like appearance. Pill badges are often used to display counts or labels in a more visually prominent and stylish way.

Badge Badge Badge Badge Badge Badge Badge Badge

Progress Bars


Progress Bars

Progress components are built with two HTML elements, some CSS to set the width, and a few attributes.

Bootstrap provides several types of progress bars.

Add class active to animate the progress bar

Colored Progress Bars

Progress bars can also be stacked.

Progress Bar

60%

50%

60%

60%

60%

60%

60%

40%
30%
20%



--- Happy Coding ---