VOOZH about

URL: https://www.geeksforgeeks.org/css/primer-css-labels-counters/

โ‡ฑ Primer CSS Labels Counters - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Primer CSS Labels Counters

Last Updated : 23 Jul, 2025

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHubโ€™s design system.

Primer CSS offers a Counter component that is used to attach the count to the navigational elements or buttons. Generally, the counter has three forms i.e Counter, Counter--primary, and Counter--secondary. Note that the visibility of the counter is hidden when it is empty.

Primer CSS Counters:

  • Counter: This class is used to define a counter component in labels. 
  • Counter--primary: This class is used to define the counter component that has a stronger background color.
  • Counter--secondary: This class is used to define the counter component that has a more subtle text color.

Syntax:

<span class="Counter mr-1 Counter--primary">
 ...
</span>

Example 1: Below example demonstrates the use of Primer CSS Counters.

Output:

๐Ÿ‘ Image
Primer CSS Counters

Example 2: Below example demonstrates the use of Primer CSS Counters on tabs.

Output:

๐Ÿ‘ Image
Primer CSS Counters

Reference: https://primer.style/#counters

Comment