New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-menubar

Package Overview
Dependencies
Maintainers
0
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-menubar

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is @radix-ui/react-menubar?

@radix-ui/react-menubar is a React component library for building accessible and customizable menubar interfaces. It provides a set of components and hooks to create complex menubar structures with ease, ensuring accessibility and usability.

What are @radix-ui/react-menubar's main functionalities?

Basic Menubar

This code demonstrates how to create a basic menubar with 'File' and 'Edit' menus, each containing several items.

```jsx
import { Menubar, MenubarItem, MenubarTrigger, MenubarContent } from '@radix-ui/react-menubar';

function BasicMenubar() {
  return (
    <Menubar>
      <MenubarItem>
        <MenubarTrigger>File</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>New</MenubarItem>
          <MenubarItem>Open</MenubarItem>
          <MenubarItem>Save</MenubarItem>
        </MenubarContent>
      </MenubarItem>
      <MenubarItem>
        <MenubarTrigger>Edit</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>Undo</MenubarItem>
          <MenubarItem>Redo</MenubarItem>
        </MenubarContent>
      </MenubarItem>
    </Menubar>
  );
}
```

Nested Menubar

This code demonstrates how to create a nested menubar with a 'File' menu that contains an 'Export' submenu with 'PDF' and 'Word' options.

```jsx
import { Menubar, MenubarItem, MenubarTrigger, MenubarContent } from '@radix-ui/react-menubar';

function NestedMenubar() {
  return (
    <Menubar>
      <MenubarItem>
        <MenubarTrigger>File</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>New</MenubarItem>
          <MenubarItem>Open</MenubarItem>
          <MenubarItem>
            <MenubarTrigger>Export</MenubarTrigger>
            <MenubarContent>
              <MenubarItem>PDF</MenubarItem>
              <MenubarItem>Word</MenubarItem>
            </MenubarContent>
          </MenubarItem>
        </MenubarContent>
      </MenubarItem>
    </Menubar>
  );
}
```

Custom Styling

This code demonstrates how to apply custom styling to the menubar and its items using CSS classes.

```jsx
import { Menubar, MenubarItem, MenubarTrigger, MenubarContent } from '@radix-ui/react-menubar';
import './customStyles.css';

function CustomStyledMenubar() {
  return (
    <Menubar className="custom-menubar">
      <MenubarItem className="custom-menubar-item">
        <MenubarTrigger className="custom-menubar-trigger">File</MenubarTrigger>
        <MenubarContent className="custom-menubar-content">
          <MenubarItem className="custom-menubar-item">New</MenubarItem>
          <MenubarItem className="custom-menubar-item">Open</MenubarItem>
        </MenubarContent>
      </MenubarItem>
    </Menubar>
  );
}
```

Other packages similar to @radix-ui/react-menubar

FAQs

Package last updated on 05 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc