Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Bootstrap
  • Tailwind
  • Bulma
  • Foundation
  • Primer
  • Spectre
  • Onsen UI
  • Semantic UI
  • Pure CSS
  • Materialize
  • SASS
  • LESS
  • Blaze UI
  • CSS Frameworks
  • Color Picker
  • CSS
  • CSS Formatter
  • Web Technology
Open In App
Next Article:
Primer CSS Box Elements
Next article icon

Primer CSS Labels Elements

Last Updated : 29 Jun, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

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.

HTML
<!DOCTYPE html> <html>  <head>     <meta name="viewport" content=           "width= device-width, initial-scale = 1">      <link rel="stylesheet" href= "https://unpkg.com/@primer/[email protected]/dist/primer.css">  </head> <style>     body{         background-color:lightgrey;         text-align:center;     }     span{         background-color:lightblue;     } </style>  <body>     <h1 style="color:green;">         GeeksforGeeks     </h1>          <h3>Primer CSS Issue Label</h3>     <span class="IssueLabel color-bg-accent-emphasis                   color-fg-on-emphasis mr-2">          GeeksforGeeks          <svg width="16" height="16" fill="currentColor"                  class="bi bi-laptop" viewBox="0 0 16 16">                 <path d="M13.5 3a.5.5 0 0 1 .5.5V11H2V3.5a.5.5              0 0 1 .5-.5h11zm-11-1A1.5 1.5 0 0 0 1              3.5V12h14V3.5A1.5 1.5 0 0 0 13.5 2h-11zM0 12.5h16a1.5              1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 12.5z"/>         </svg>     </span>     <span class="IssueLabel color-bg-danger-emphasis                   color-fg-on-emphasis mr-2">         Practice and Remarks     </span><br><br>     <h3>Primer CSS Diffstat</h3>     <span class="diffstat tooltipped tooltipped-w"            aria-label="10 changes: 7 additions, 3 deletions">10         <span class="diffstat-block-added"></span>         <span class="diffstat-block-deleted"></span>                       <span class="diffstat-block-neutral"></span>     </span>         </body> </html> 

Output:

 

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

HTML
<!DOCTYPE html> <html>  <head>     <meta name="viewport" content=           "width= device-width, initial-scale = 1">      <link rel="stylesheet" href= "https://unpkg.com/@primer/[email protected]/dist/primer.css">  </head> <style>     body{         background-color:lightgrey;         text-align:center;     }     span{         background-color:lightblue;     } </style>  <body>     <h1 style="color:green;">         GeeksforGeeks     </h1>          <h3> Primer CSS Counters Labels </h3>       <span class="Counter mr-1 mt-3 Counter--primary">         99     </span>     <a href="#" class="tabnav-tab" aria-current="page">             Tutorials          <span class="Counter">             66         </span>     </a>     <br><br>     <h3>Primer CSS States</h3>        <span class="State State--draft mr-2 mt-3">         Default State     </span>       <span class="State State--open mr-2 mt-3">         Open State     </span>       <span class="State State--merged mr-2 mt-3">         Merged State     </span>       <span class="State State--closed mr-2 mt-3">         Close State     </span>     </body> </html> 

Output:

 

Reference: https://primer.style/css/components/labels


Next Article
Primer CSS Box Elements

G

geetanjali16
Improve
Article Tags :
  • Web Technologies
  • CSS
  • Primer-CSS
  • Primer-CSS Component

Similar Reads

  • Primer CSS Labels Default
    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. It is a system that assists us to build consistent user experiences efficiently with enough flexibility. This systematic approach e
    2 min read
  • Primer CSS Labels
    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
    3 min read
  • Primer CSS Issue Labels
    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
    2 min read
  • Primer CSS Box Elements
    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. It is a system that assists us to build consistent user experiences efficiently with enough flexibility. This systematic approach e
    2 min read
  • Primer CSS Details
    Primer CSS is a free open-source CSS framework that is built upon a GitHub design system to provide support to the broad spectrum of GitHub websites. It creates the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are stead
    2 min read
  • CSS element Selector
    The element selector in CSS is used to select HTML elements that are required to be styled. In a selector declaration, there is the name of the HTML element and the CSS properties which are to be applied to that element is written inside the brackets {}. Syntax: element { \\ CSS property}Example 1:
    2 min read
  • Primer CSS Labels Counters
    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
    2 min read
  • Primer CSS Layout Floats
    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
    2 min read
  • CSS Pseudo Elements
    A pseudo-element is a keyword added to a selector that lets you style specific parts of an element. For example, you can style the first line of a paragraph, add content before or after an element, or create complex effects with minimal code. Pseudo-elements are denoted by a double colon (::) (or :
    5 min read
  • Primer CSS Lean Markup
    Primer CSS is a free open-source CSS framework that is built upon a GitHub design system to provide support to the broad spectrum of GitHub websites. It creates the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are stead
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences