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

@rsuite/react-frame

v1.0.1

Published

react frame

Downloads

121

Readme

React Frame

基于 Rsuite 封装的 Frame 结构。

<Frame> 包含:

  • <Frame.Nav> 显示侧边栏。包括产品列表、左侧菜单栏。其中菜单栏需要由使用者自行传入
  • <Frame.Content> Content 内容区域

Demo

用法

安装

yarn add @rsuite/react-frame

// 或
npm install @rsuite/react-frame

引入 less

@import '~@rsuite/rsuite-frame/lib/styles/less/index.less';

在代码中引入

import Frame from 'rsuite-frame';

Demo

Frame 结构如下:

其中 Frame 固定的是 1、2、3 部分。使用者可以自行传入菜单栏和 content 内容。

<Frame>
  <Frame.Nav
    logo={this.getLogo()}
    iconName="DMP-color"
    expand={expand}
    activeName="Insight"
  >
    // 这里是菜单栏的代码
  </Frame.Nav>
  <Frame.Content>content</Frame.Content>
</Frame>

Props

<Frame>

| Name | Type | Description | | --------- | ---------- | ----------- | | children | React.Node | | | className | string | | | style | Object | |

<Frame.Nav>

| Name | Type | Description | | ----------------- | ---------- | ---------------------------- | | brand | React.Node | 侧边栏收起状态下显示的 Icon | | children | React.Node | | | className | string | | | expand | boolean | (受控)侧边栏的是否展开的状态 | | onExpand | () => void | 侧边栏展开关闭回调 | | onRenderBottomNav | ()=> void | 底部侧边栏渲染方法 | | renderTitle | () => any | 标题 | | showMenu | boolean | 是否隐藏菜单 | | style | Object | |

AppType:

type AppType = {
  name: string,
  code?: string,
  url: string
}

activeNameactiveCode 取其一即可。

其中 <Frame.Nav> 的大部分 props 都来自于 rsuite-grid-sidebar,具体的说明及用法可以看 rsuite-grid-sidebar 的文档

<Frame.Content>

| Name | Type | Description | | --------- | ---------- | ----------- | | children | React.Node | | | className | string | | | style | Object | |