0.0.47 • Published 3 years ago

rc-scroll-nav-bar v0.0.47

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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

0.0.47

3 years ago

0.0.46

3 years ago

0.0.45

3 years ago

0.0.44

3 years ago

0.0.43

3 years ago

0.0.42

3 years ago

0.0.41

3 years ago

0.0.40

3 years ago

0.0.39

3 years ago

0.0.38

3 years ago

0.0.37

3 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago

0.0.32

3 years ago

0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.10

3 years ago

0.0.1

3 years ago