VOOZH about

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

โ‡ฑ Primer CSS Labels Elements - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Primer CSS Labels Elements

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.

In this article, we will learn various Primer CSS Labels Elements. Primer CSS offers Labels that provide some metadata to the user or indicates the status of an item. There are 3 types of labels, Labels to indicate metadata, States to show the status, and Counters to indicate the count of a number of items. 

Primer CSS Labels elements:

  • Labels: This class is used to define a base label.
  • Issue Labels: This class is used to create an issue label that is used to add labels for pull requests or any issue.
  • States: This class is used to define a state label that informs the user about the status of an item.
  • Counters: This class is used to define a counter component in labels that are used to attach the count to the navigational elements or buttons. 
  • Diffstat: This class is used to create an element of diffstat types that can be used to display the total number of counts of addition or deletion a particular diff contains.

Note: Please refer to the links of Primer CSS Labels elements mentioned above for the respective type of Label element followed by the codes for better understanding. A few sample programs are given below.

Syntax:

 <span class="<label-element-classes> ...">
  ....
 </span> 

Example 1:  The following code demonstrates the issue labels and diffstat labels.

Output:

๐Ÿ‘ Image
 

Example 2: The following code demonstrates the counter and state labels.

Output:

๐Ÿ‘ Image
 

Reference: https://primer.style/

Comment