0.3.1 • Published 2 years ago

react-native-menubar-extra v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-menubar-extra

Easily add native menubar (NSMenu) to your React Native MacOS App.

!WARNING This library supports only react-native-macos

Installation

yarn add react-native-menubar-extra
# or ---
npm install react-native-menubar-extra
cd macos && pod install

Usage

import { MenuBarExtraItem, MenubarExtraView } from 'react-native-menubar-extra';

const MenuBar = () => {
  return (
    <MenubarExtraView icon="car">
      <MenuBarExtraItem
        title="Item 1"
        onItemPress={() => {
          console.log('Item pressed');
        }}
      />
    </MenubarExtraView>
  );
};

For more advanced example check out the example folder.

Reference

MenuBarExtraView

Container view that sets up root menu.

PropDescription
titleTitle that will appear next to icon in system status bar.
iconName of SF Symbol as string that will appear in system status bar.

Important: Don't pass other types of components as children as it will break the indexing in the menu.

MenuBarExtraItem

PropDescription
titleThe menu item's title
iconName of SF Symbol as string that will be rendered next to item's title.
onItemClickCallback that is called after clicking on menu item.
keyEquivalentThe menu item’s unmodified key equivalent. For example: "1" or "A".
keyEquivalentModifierMaskThe menu item’s keyboard equivalent modifiers. Default: COMMAND

MenuBarExtraSeparator

Separator displayed between items. Needs to have at least one item above and below.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago