Open In App

Primer CSS Select menu List Items

Improve
Improve
Like Article
Like
Save
Share
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.

Primer CSS Select menu is the component that can be used for navigation, filtering, etc. Primer CSS Select menu List Items is used to create the menu with some list items. List items can be the text with avatars, icons, multi-line text, etc. In this article, we will discuss Primer CSS Select menu List Items.

Primer CSS Select menu List Items Class:

  • SelectMenu-item: This class is used to create the list item.

Syntax:

<button class="SelectMenu-item" >
    Content
</button>

Example 1: The following example demonstrates the Primer CSS Select menu List Items.

HTML




<!DOCTYPE html>
<html>
<head>
    <title> Primer CSS Select menu List Items </title>
    <link rel="stylesheet" 
          href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css"/>
</head>
  
<body class="m-2">
    <h1 class="color-fg-success"> GeeksforGeeks </h1>
    <h3> Primer CSS Select menu List Items </h3> <br>
  
    <details class="details-reset details-overlay" open>
        <summary class="btn" aria-haspopup="true">
            Choose any one
        </summary>
        <div class="SelectMenu">
            <div class="SelectMenu-modal">
                <header class="SelectMenu-header">
                    <h3 class="SelectMenu-title">
                        Languages
                    </h3>
                </header>
      
                <div class="SelectMenu-list">
                    <button class="SelectMenu-item" >
                        Java
                    </button>
                    <button class="SelectMenu-item" >
                        Python
                    </button>
                    <button class="SelectMenu-item" >
                        C++
                    </button>
                </div>
            </div>
        </div>
    </details>
</body>
  
</html>


Output:

Primer CSS Select menu List Items

Example 2: The following example demonstrates the Primer CSS Select menu List Items along with avatars and SVG icons.

HTML




<!DOCTYPE html>
<html>
<head>
    <title> Primer CSS Select menu List Items </title>
    <link rel="stylesheet" 
          href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css"/>
</head>
  
<body class="m-2">
    <h1 class="color-fg-success"> GeeksforGeeks </h1>
    <h3> Primer CSS Select menu List Items </h3> <br>
  
    <details class="details-reset details-overlay" open>
        <summary class="btn" aria-haspopup="true">
            Choose any one
        </summary>
        <div class="SelectMenu">
            <div class="SelectMenu-modal">
                <header class="SelectMenu-header">
                    <h3 class="SelectMenu-title">
                        Languages
                    </h3>
                </header>
      
                <div class="SelectMenu-list">
                    <button class="SelectMenu-item" >
                        <img class="avatar avatar-small mr-2" 
                             height="20" width="20" src=
                        Java
                    </button>
                    
                    <button class="SelectMenu-item" >
                        Python
                        <svg class="octicon ml-2"
                             width="18" height="18" 
                             viewBox="0 0 16 16"
                             aria-hidden="true" >
                            <path fill-rule="evenodd" 
                                d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 
                                4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 
                                3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z">
                            </path>
                        </svg>
                    </button>
                    
                    <button class="SelectMenu-item" >
                        C++
                        <span class="Counter ml-1"> 5 </span>
                    </button>
                </div>
            </div>
        </div>
    </details>
</body>
  
</html>


Output:

Primer CSS Select menu List Items

Reference: https://primer.style/css/components/select-menu#list-items



Last Updated : 19 Apr, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads