Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a total count of messages / alerts indicator in Bootstrap?

I am not familiar with the exact term and keyword to search and Iam just begining to design. So I would like to ask if the term alert indicator is correct.

And how do I be able to do it on Twitter Bootstrap?

below is the image of the indicator i would like to accomplish. Thanks..

enter image description here

like image 561
Clannad System Avatar asked Aug 27 '13 16:08

Clannad System


People also ask

How to count number of notification on an icon in Bootstrap?

- GeeksforGeeks How to count number of notification on an icon? Bootstrap provides us with badges to display counts on an icon which can be used to show unread notifications/messages etc. We need to get the value of count on the icon badge and update that value accordingly.

What are Bootstrap alert popups?

What are Bootstrap alert popups? A Bootstrap alert popup is a build-in component designed to provide feedback on typical users' actions. Eight contextual classes provide the default Bootstrap colors.

What is Bootstrap toast push notifications?

Bootstrap notification / toast Push notifications to your visitors with a 'toast', a lightweight and easily customizable alert message. Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems.

How do I add an icon to a bootstrap popup?

Bootstrap alert popup with a custom gradient background and icon Add an icon to the left of the alert. You can also choose to add images to your Bootstrap alert popup. This image comes from pixabay.com.


1 Answers

Take a look at Bootstrap's Badges: http://getbootstrap.com/components/#badges

Make a class that specifies a container for a glyphicon and badge and places the badge at a fixed offset from the icon. Something like this:

<div class="notification-icon">
    <span class="glyphicon glyphicon-envelope"></span>
    <span class="badge">19</span>
</div>

With CSS like this:

.notification-icon .glyphicon {
    ...
}

.notification-icon .badge {
    ...
}

You should easily be able to set it up so that the badge only shows when you have a nonzero number of notifications.

like image 55
Timothy Shields Avatar answered Oct 07 '22 17:10

Timothy Shields