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

rc-scroll-nav-bar

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-scroll-nav-bar

A scroll navigation component based on react

  • 0.0.47
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
36
decreased by-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

rc-scroll-nav-bar

介绍

基于react的滚动导航组件

特性
  • 支持React
  • 支持TypeScript
安装
yarn add rc-scroll-nav-bar -S
or
npm add rc-scroll-nav-bar -S
如何使用
import { ScrollNavbar } from "rc-scroll-nav-bar";

function App() {
    const tabs = [
        {
            lable: '测试',
            value: 0,
        },
        {
            lable: '测试数据2',
            value: 1,
        },
        {
            lable: '测试数据3',
            value: 2,
        },
        {
            lable: '测试4',
            value: 3,
        },
        {
            lable: '测试数据5',
            value: 4,
        },
        {
            lable: '数据6',
            value: 5,
        },
        {
            lable: '数据7',
            value: 6,
        },
    ];

    return (
        <div className="App">
            <ScrollNavbar tabs={tabs}></ScrollNavbar>
        </div>
    );
}

export default App;

配置项
属性名说明类型必填默认值
fontSize字体大小numberfalse16
height高度numberfalse40
activeKey激活索引numberfalse0
tabs元素列表tabsType[]true[]
right右边固定内容ReactNodefalse-
fixedStart固定首个元素booleanfalsetrue
rightClass右边盒子类名stringfalse-
tail尾部内容ReactNodefalse-
offsetTop距离顶部偏移距离numberfalse0
isSticky是否启用粘性布局booleanfalsetrue
activeLineOffsetTop激活元素下方的横线距离文字的距离numberfalse0
scrollOffsetLeft滚动元素偏移量numberfalse0
itemGap元素间距numberfalse32
onRightClick右边盒子点击事件() => voidfalse-
onChange元素点击事件(index: number, item: tabsType) => voidfalse-
预览

test.gif

License

MIT

Keywords

FAQs

Package last updated on 15 Nov 2022

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