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

4 years ago

0.0.40

4 years ago

0.0.39

4 years ago

0.0.38

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.34

4 years ago

0.0.33

4 years ago

0.0.32

4 years ago

0.0.31

4 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.27

4 years ago

0.0.26

4 years ago

0.0.25

4 years ago

0.0.24

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.10

4 years ago

0.0.1

4 years ago