Badge - 图1

Badge

Badges are used to display/indicate count numbers and labels on different elements of your app.

Badge Layout

Badges have a super simple layout, it’s just an element with a **badge** class:

  1. <span class="badge">32</span>

Badge Colors

Badges support all default colors:

  1. <!-- Green badge -->
  2. <span class="badge color-green">32</span>
  3. <!-- Red badge -->
  4. <span class="badge color-red">15</span>

Examples

  1. <div class="page">
  2. <div class="navbar">
  3. <div class="navbar-inner">
  4. <div class="left"></div>
  5. <div class="title">Badge</div>
  6. <div class="right">
  7. <a class="link icon-only">
  8. <i class="icon f7-icons ios-only">person_fill<span class="badge color-red">5</span></i>
  9. <i class="icon material-icons md-only">person<span class="badge color-red">5</span></i>
  10. </a>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="toolbar tabbar tabbar-labels">
  15. <div class="toolbar-inner">
  16. <a href="#tab-1" class="tab-link tab-link-active">
  17. <i class="icon icon-fill f7-icons ios-only">email_fill<span class="badge color-green">5</span></i>
  18. <i class="icon material-icons md-only">email<span class="badge color-green">5</span></i>
  19. <span class="tabbar-label">Inbox</span>
  20. </a>
  21. <a href="#tab-2" class="tab-link">
  22. <i class="icon f7-icons ios-only">today<span class="badge color-red">7</span></i>
  23. <i class="icon material-icons md-only">today<span class="badge color-red">7</span></i>
  24. <span class="tabbar-label">Calendar</span>
  25. </a>
  26. <a href="#tab-3" class="tab-link">
  27. <i class="icon f7-icons ios-only">cloud<span class="badge color-red">1</span></i>
  28. <i class="icon material-icons md-only">file_upload<span class="badge color-red">1</span></i>
  29. <span class="tabbar-label">Upload</span>
  30. </a>
  31. </div>
  32. </div>
  33. <div class="page-content">
  34. <div class="list">
  35. <ul>
  36. <li>
  37. <div class="item-content">
  38. <div class="item-inner">
  39. <div class="item-title">Foo Bar</div>
  40. <div class="item-after"><span class="badge">0</span></div>
  41. </div>
  42. </div>
  43. </li>
  44. <li>
  45. <div class="item-content">
  46. <div class="item-inner">
  47. <div class="item-title">Ivan Petrov</div>
  48. <div class="item-after"><span class="badge color-blue">CEO</span></div>
  49. </div>
  50. </div>
  51. </li>
  52. <li>
  53. <div class="item-content">
  54. <div class="item-inner">
  55. <div class="item-title">John Doe</div>
  56. <div class="item-after"><span class="badge color-green">5</span></div>
  57. </div>
  58. </div>
  59. </li>
  60. <li>
  61. <div class="item-content">
  62. <div class="item-inner">
  63. <div class="item-title">Jane Doe</div>
  64. <div class="item-after"><span class="badge color-orange">NEW</span></div>
  65. </div>
  66. </div>
  67. </li>
  68. </ul>
  69. </div>
  70. </div>
  71. </div>