🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

rc-scroll-nav-bar

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
Version published
Weekly downloads
5
-58.33%
Maintainers
1
Weekly downloads
 
Created

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

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