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:
ReactJS Semantic UI Breadcrumb Collections
Next article icon

ReactJS Semantic UI Menu Collections

Last Updated : 04 Mar, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks.

In this article we will know how to use Menu Collections in ReactJS Semantic UI. Menu Collections is used to make a menu that contains some information.

Properties:

  • Secondary Menu: We can adjust the menu appearance to de-emphasize the content by using this property.
  • Pointing: We can make a pointing menu that points to its nearby content by making this property.
  • Tabular: We can make a menu in tabular form by using this property.
  • Text: We can make menu for text contents by using this property.
  • Vertical Menu: It is used to create a vertical menu .
  • Pagination: It is used to make a pagination menu.

States:

  • Hover: We can make a menu that can be hovered by using this state.
  • Active: We can make an active menu by using active state.
  • Disabled: A menu can be disabled using this state.
 

Syntax:

<menu>    <menu.Item>      Content    </menu.Item>  </menu/>

Creating React Application And Installing Module:

  • Step 1: Create a React application using the following command.
    npx create-react-app foldername
  • Step 2: After creating your project folder i.e. foldername, move to it using the following command.
    cd foldername
  • Step 3: Install semantic UI in your given directory.
     npm install semantic-ui-react semantic-ui-css

Project Structure: It will look like the following.

Step to Run Application: Run the application  from the root directory of the project, using the following command.

npm start

Example 1: This is the basic example that shows how to use menu collections by using ReactJS Semantic UI Menu Collections.

App.js
import React,{Component} from 'react' import { Menu } from 'semantic-ui-react'  const styleLink = document.createElement("link"); styleLink.rel = "stylesheet"; styleLink.href =  "https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.css"; document.head.appendChild(styleLink);  export default class MenuExampleBasic extends Component {   state = {}    btt = ({ name }) => this.setState({ activeItem: name })    render() {     const { gfg1 } = this.state      return (       <Menu>         <Menu.Item           name='GeeksforGeeks'           active={gfg1 === 'GeeksforGeeks'}           onClick={this.btt}>           GeeksforGeeks         </Menu.Item>         <Menu.Item           name='ReactJS'           active={gfg1 === 'ReactJS'}           onClick={this.btt}>           ReactJS         </Menu.Item>         <Menu.Item           name='SemanticUI'           active={gfg1 === 'SemanticUI'}           onClick={this.btt}>           SemanticUI         </Menu.Item>       </Menu>     )   } } 

Output: 

Example 2: In this example, we are showing the disabled state in a menu collection by using ReactJS Semantic UI Menu Collections.

App.js
import React,{Component} from 'react' import { Menu } from 'semantic-ui-react'  const styleLink = document.createElement("link"); styleLink.rel = "stylesheet"; styleLink.href =  "https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.css"; document.head.appendChild(styleLink);  export default class MenuExampleBasic extends Component {   state = {}    btt = ({ name }) => this.setState({ activeItem: name })    render() {     const { gfg1 } = this.state      return (       <Menu>         <Menu.Item disabled           name='GeeksforGeeks'           active={gfg1 === 'GeeksforGeeks'}           onClick={this.btt}>           GeeksforGeeks         </Menu.Item>         <Menu.Item disabled           name='ReactJS'           active={gfg1 === 'ReactJS'}           onClick={this.btt}>           ReactJS         </Menu.Item>         <Menu.Item disabled           name='SemanticUI'           active={gfg1 === 'SemanticUI'}           onClick={this.btt}>           SemanticUI         </Menu.Item>       </Menu>     )   } } 

Output:

Reference: https://react.semantic-ui.com/collections/menu


Next Article
ReactJS Semantic UI Breadcrumb Collections
author
taran910
Improve
Article Tags :
  • Web Technologies
  • ReactJS
  • Semantic-UI

Similar Reads

  • ReactJS Semantic UI Form collections
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article, we will know how to use form collections in Reac
    3 min read
  • ReactJS Semantic UI Grid Collections
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use grid collections in React
    2 min read
  • ReactJS Semantic UI Message Collection
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use message collections in Re
    2 min read
  • ReactJS Semantic UI Table Collections
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use table collections in Reac
    3 min read
  • ReactJS Semantic UI Breadcrumb Collections
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use breadcrumb collections in
    2 min read
  • ReactJS Semantic UI container Element
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article, we will know how to use Container elements in Re
    2 min read
  • Semantic-UI Collections Complete Reference
    Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing. Semantic-UI BreadcrumbSemantic-UI Breadcrumb TypesSemantic-UI Breadcrumb TypeSemantic
    3 min read
  • ReactJS Semantic UI button Element
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS and jQuery to incorporate in different frameworks. In this article, we will know how to use button element in ReactJS Sema
    2 min read
  • ReactJS Semantic UI List Element
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use the List element in React
    2 min read
  • ReactJS Semantic UI Step Element
    Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks. In this article we will know how to use the step element in React
    2 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