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

@txdfe/at-nav

v1.0.0

Published

AT业务组件 - 导航

Downloads

74

Readme

at-nav


简介

Teambition 导航

使用示例

import Nav from '@txdfe/at-nav';

const { Item } = Nav;

class Demo extends React.Component {
  render() {
    return (
      <Nav maxCount={4}>
        <Item icon="dingding" label="菜单项一" key="a" />
        <Item icon="zhihu" label={<a href="//www.taobao.com">菜单二</a>} key="b" />
        <Item icon="wechat" label="菜单项三" key="c" />
        <Item icon="teambition" label="菜单项四" key="d" />
        <Item icon="evernote" label="菜单项五" key="e" />
        <Item icon="github" label="菜单项六" key="f" />
      </Nav>
    );
  }
}

ReactDOM.render(<Demo />, mountNode);

API

Nav

| 参数 | 类型 | 可选值 | 默认值 | 是否必填 | 说明 | | :--- | :--- | :--- | :--- | :--- | :--- | | className | String | 无 | 无 | 否 | 设置额外的className | | style | Object | 无 | 无 | 否 | 设置额外的样式 | | maxCount | Number | 无 | 5 | 否 | 显示的主导航项数,多余的会被收起。只在子元素为Nav.Item时有效 | | defaultSelectedKey | String | 无 | 无 | 否 | 默认选中的key,非受控 | | selectedKey | String | 无 | 无 | 否 | 选中的key,受控 | | onSelect | Function | 无 | (selectedKey) => {} | 否 | 选中某项的回调 | | defaultExpandedKeys | String[] | 无 | 无 | 否 | 默认展开带子导航项的主导航的key数组,非受控 | | expandedKeys | String[] | 无 | 无 | 否 | 展开的key,受控 | | onExpand | Function | 无 | (expandedKeys) => {} | 否 | 展开带子导航项的主导航回调 |

Nav.Group

| 参数 | 类型 | 可选值 | 默认值 | 是否必填 | 说明 | | :--- | :--- | :--- | :--- | :--- | :--- | | label | ReactNode | 无 | 无 | 是 | 显示的组标题 | | maxCount | Number | 无 | 5 | 否 | 组内默认显示的主导航数,多余的会被隐藏 |

Nav.Item

| 参数 | 类型 | 可选值 | 默认值 | 是否必填 | 说明 | | :--- | :--- | :--- | :--- | :--- | :--- | | key | String | 无 | 无 | 否 | 唯一标记 | | icon | String|ReactNode | 所有@txdfe/at提供的icon类型或者<Icon type='xxx'>| 是 | 设置图标 | | label | ReactNode | 无 | 无 | 是 | 显示的标题 | | extra | ReactNode | 无 | 无 | 否 | 默认在右侧显示的内容 | | hoverExtra | String | 无 | 无 | 否 | hover时右侧显示的内容 |

Nav.SubItem

| 参数 | 类型 | 可选值 | 默认值 | 是否必填 | 说明 | | :--- | :--- | :--- | :--- | :--- | :--- | | key | String | 无 | 无 | 否 | 唯一标记 | | label | ReactNode | 无 | 无 | 是 | 显示的标题 | | extra | ReactNode | 无 | 无 | 否 | 默认在右侧显示的内容 | | hoverExtra | String | 无 | 无 | 否 | hover时右侧显示的内容 |