How to use terra-menu - 10 common examples

To help you get started, we’ve selected a few terra-menu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-core / packages / terra-collapsible-menu-view / src / _CollapsibleMenu.jsx View on Github external
contentWidth={contentWidth}
        >
          {this.wrapChildrenOnClick(children)}
        
        {clonedButton}
      
    );
  }
}

CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
  widths: Menu.Opts.widths,
};

export default CollapsibleMenu;
github cerner / terra-core / packages / terra-collapsible-menu-view / src / _CollapsibleMenu.jsx View on Github external
const cx = classNames.bind(styles);

const propTypes = {
  /**
   * List of CollapsibleMenuView.Item(s)/CollapsibleMenuView.ItemGroup(s)/CollapsibleMenuView.Divider(s) to be displayed as content within the Menu.
   */
  children: PropTypes.node.isRequired,
  /**
   * Bounding container for the menu, will use window if no value provided.
   */
  boundingRef: PropTypes.func,
  /**
   * A string representation of the width in px, limited to:
   * 160, 240, 320, 640, 960, 1280, 1760, or auto
   */
  contentWidth: PropTypes.oneOf(Object.keys(Menu.Opts.widths)),

  /**
   * Button to display the menu from
   */
  button: PropTypes.element.isRequired,
};

const childContextTypes = {
  isCollapsibleMenuItem: PropTypes.bool,
};

class CollapsibleMenu extends React.Component {
  constructor(props) {
    super(props);
    this.handleRequestClose = this.handleRequestClose.bind(this);
    this.wrappedOnClick = this.wrappedOnClick.bind(this);
github cerner / terra-framework / packages / terra-framework-site / src / app / common / header-templates / Utility.jsx View on Github external
<button>
          {!!accessory &amp;&amp; <div>{accessory}</div>}
          {!!title &amp;&amp; size !== 'tiny' &amp;&amp; <div>{title}</div>}
          {}
        </button>
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;
github cerner / terra-dev-site / src / app / common / header-templates / Utility.jsx View on Github external
onClick={this.handleOnClick}
          icon={buttonIcon}
          variant="utility"
        /&gt;
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;

Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;
github cerner / terra-framework / packages / terra-framework-site / src / app / common / header-templates / Utility.jsx View on Github external
&gt;
          {menuItems}
        
        <button>
          {!!accessory &amp;&amp; <div>{accessory}</div>}
          {!!title &amp;&amp; size !== 'tiny' &amp;&amp; <div>{title}</div>}
          {}
        </button>
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;
github cerner / terra-core / packages / terra-collapsible-menu-view / src / _CollapsibleMenu.jsx View on Github external
isArrowDisplayed
          isOpen={this.state.isOpen}
          targetRef={this.getButtonNode}
          contentWidth={contentWidth}
        &gt;
          {this.wrapChildrenOnClick(children)}
        
        {clonedButton}
      
    );
  }
}

CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
  widths: Menu.Opts.widths,
};

export default CollapsibleMenu;
github cerner / terra-dev-site / src / app / common / header-templates / Utility.jsx View on Github external
<button>
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;

Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;
</button>
github cerner / terra-core / packages / terra-collapsible-menu-view / src / _CollapsibleMenu.jsx View on Github external
isOpen={this.state.isOpen}
          targetRef={this.getButtonNode}
          contentWidth={contentWidth}
        &gt;
          {this.wrapChildrenOnClick(children)}
        
        {clonedButton}
      
    );
  }
}

CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
  widths: Menu.Opts.widths,
};

export default CollapsibleMenu;
github cerner / terra-framework / packages / terra-framework-site / src / app / common / header-templates / Utility.jsx View on Github external
{menuItems}
        
        <button>
          {!!accessory &amp;&amp; <div>{accessory}</div>}
          {!!title &amp;&amp; size !== 'tiny' &amp;&amp; <div>{title}</div>}
          {}
        </button>
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;
github cerner / terra-dev-site / src / app / common / header-templates / Utility.jsx View on Github external
{...customProps}
          text="Utility Menu"
          onClick={this.handleOnClick}
          icon={buttonIcon}
          variant="utility"
        /&gt;
      
    );
  }
}

Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;

Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;

export default Utility;

terra-menu

The menu is a popup component that displays a list of items, item groups, and dividers. Menu Items can be actionable, have toggle-style selection, or have nested submenu items. Menu Item groups are a single-select grouping of menu items. The Menu will det

Apache-2.0
Latest version published 7 months ago

Package Health Score

54 / 100
Full package analysis