npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uxcore-menu

v4.0.7

Published

uxcore-menu component for uxcore.

Downloads

110

Readme


uxcore-menu Dependency Status devDependency Status

TL;DR

uxcore-menu ui component for react

setup develop environment

$ git clone https://github.com/uxcore/uxcore-menu
$ cd uxcore-menu
$ npm install
$ gulp server

Usage

import ReactDOM from 'react-dom';
import RcMenu, {SubMenu, Item, Divider} from 'rc-menu';

ReactDOM.render(
	<Menu >
		<Item key="mail">
			<i className="kuma-icon kuma-icon-email"></i>导航一
		</Item>
		<Item key="app">
			<i className="kuma-icon kuma-icon-wangwang"></i>导航二
		</Item>
		<SubMenu title={<span><i className="kuma-icon kuma-icon-setting"></i>导航 - 子菜单</span>}>
			<Item key="setting:1">选项1</Item>
			<Item key="setting:2">选项2</Item>
			<Item key="setting:3">选项3</Item>
			<Item key="setting:4">选项4</Item>
		</SubMenu>
		<Item key="alipay">
			<a href="#" target="_blank">导航四 - 链接</a>
		</Item>
	</Menu>,
	target);

demo

http://uxcore.github.io/uxcore/components/menu/

API

Props

Menu

| 配置项 | 说明 | 类型 | 默认值 | |---|---|---|---| | mode | 菜单类型 | enum 'vertical', 'horizontal', 'inline' | vertical | | selectedKeys | 当前选中的菜单项 key 数组 | | | | defaultSelectedKeys | 初始选中的菜单项 key 数组 | | | | openKeys | 当前展开的菜单项 key 数组 | | | | defaultOpenKeys | 初始展开的菜单项 key 数组 | | | | onSelect | 被选中时调用,参数 {item, key, selectedKeys} 对象 | function | 无 | | onDeselect | 取消选中时调用,参数 {item, key, selectedKeys} 对象,仅在 multiple 生效 | function | 无 | | onOpenChange | 菜单打开或关闭时调用,参数 openKeys 数组 | function | 无 | | onOpen | 同 onOpenChange,为了兼容旧版本保留的方法,将来会移除。参数 {openKeys} 对象 | function | 无 | | onClose | 同 onOpenChange,为了兼容旧版本保留的方法,将来会移除。参数 {openKeys} 对象 | function | 无 | | onClick | 点击 menuitem 调用此函数,参数为 {item, key} | function | 无 | | style | 根节点样式 | object | | | lineClamp | 文字行数,超出则显示省略号(仅在 inline 模式下且支持 line-clamp 属性的浏览器上生效) | number | 1 |

Item

| 配置项 | 说明 | 类型 | 默认值 | |---|---|---|---| | disabled | 是否禁用 | Boolean | false | | key | item 的唯一标志 | String | |

SubMenu

| 配置项 | 说明 | 类型 | 默认值 | |---|---|---|---| | title | 子菜单项值 | String or React.Element | | | children | (MenuItem or SubMenu)[] | 子菜单的菜单项 | |