DocsComponentsTemplatesThemesGitHub

Menubar

Desktop-app style menu bar (File, Edit, View) with dropdown menus.

Code

import * as React from 'react';
import { Menubar } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        minHeight: 230,
      }}
    >
      <Menubar
        menus={[
          {
            label: 'File',
            items: [
              {
                label: 'New file',
                shortcut: '⌘N',
              },
              {
                label: 'Open…',
                shortcut: '⌘O',
              },
              '-',
              {
                label: 'Export',
                icon: 'download',
              },
            ],
          },
          {
            label: 'Edit',
            items: [
              {
                label: 'Undo',
                shortcut: '⌘Z',
              },
              {
                label: 'Redo',
                shortcut: '⇧⌘Z',
              },
            ],
          },
          {
            label: 'View',
            items: [
              {
                label: 'Zoom in',
                shortcut: '⌘+',
              },
            ],
          },
        ]}
      />
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { Menubar } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/menubar.json

Guidelines

  • Use in editor-like web apps; mirror commands in the CommandPalette.

Props

PropTypeRequired
menusArray<{ label: string; items: MenuProps['items'] }>Yes
labelstringNo
classNamestringNo

Edit this example on GitHub