JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q43908F
  • License MIT

Menu component for real system.

Package Exports

  • @real-system/menu
  • @real-system/menu/lib/index.js
  • @real-system/menu/lib/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@real-system/menu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@real-system/menu

Menu component for real system.

npm version

Installation

# install peer dependencies

# npm
$ npm install react react-dom @real-system/animation-library @real-system/ariakit-library @real-system/elements-primitive @real-system/state-library @real-system/styled-library @real-system/utils-library
# yarn
$ yarn add react react-dom @real-system/animation-library @real-system/ariakit-library @real-system/elements-primitive @real-system/state-library @real-system/styled-library @real-system/utils-library

# install menu

# npm
$ npm install @real-system/menu
# yarn
$ yarn add @real-system/menu

Code Example

import { Menu, MenuProps } from '@real-system/menu';

/**
 * const { Button, Group, Item, List, Separator } = Menu;
 * const { Label } = Group
 * const { Checkbox,  Command, Icon, Link, Radio } = Item
 * */

const MyComponent = () => {
  return (
    <Menu values={values} onSelect={setValues}>
      <Menu.Button
        size="sm"
        variant="outline"
        leadingIcon={<Icon icon="eye" size="xs" />}>
        Watch
      </Menu.Button>
      <Menu.List>
        <Menu.Item>My Account</Menu.Item>
        <Menu.Item>
          <Menu.Item.Icon icon="pencil-alt" />
          Edit
          <Menu.Item.Command>E</Menu.Item.Command>
        </Menu.Item>
        <Menu.Item.Radio name="watching" value="issues">
          Issues
        </Menu.Item.Radio>
        <Menu.Item.Checkbox name="watching" value="pull-requests">
          Pull requests
        </Menu.Item.Checkbox>
        <Menu.Separator />
        <Menu.Group>
          <Menu.Group.Label>Help</Menu.Group.Label>
          <Menu.Item>Docs</Menu.Item>
          <Menu.Item.Link
            href="https://system.themikewolf.com"
            external
            showExternal>
            FAQ
          </Menu.Item.Link>
        </Menu.Group>
      </Menu.List>
    </Menu>
  );
};