Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rsuite/react-frame

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rsuite/react-frame

react frame

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

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>

NameTypeDescription
childrenReact.Node
classNamestring
styleObject

<Frame.Nav>

NameTypeDescription
brandReact.Node侧边栏收起状态下显示的 Icon
childrenReact.Node
classNamestring
expandboolean(受控)侧边栏的是否展开的状态
onExpand() => void侧边栏展开关闭回调
onRenderBottomNav()=> void底部侧边栏渲染方法
renderTitle() => any标题
showMenuboolean是否隐藏菜单
styleObject

AppType:

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

activeNameactiveCode 取其一即可。

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

<Frame.Content>

NameTypeDescription
childrenReact.Node
classNamestring
styleObject

Keywords

FAQs

Package last updated on 09 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc