1.1.2 • Published 8 months ago

@zstark/index-bar v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

indexBar

Publish index-bar lib. license Commit Verison

PC 端 indexBar 插件.

Example

Live Demo

npm.io

🚀 Quick Start

npm install @zstark/index-bar --prod
import IndexBar, { scrollIntoView } from '@zstark/index-bar';

const Demo = () => {
  const onChange = useCallback((letter) => {
    const container = containerRef.current;
    const target = document.querySelector(`.${letter}`);
    if (target) {
      scrollIntoView(container, document.querySelector(`.${letter}`), -12);
    }
  }, []);

  return;
  <IndexBar letters={letters} onChange={onChange} right={10}>
    {/* you content */}
  </IndexBar>;
};

props

属性描述默认值
letters: string|string[]右侧字母索引'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
onChange: (letter: string, index: number) => void-
right: number样式. right 值-
left: number样式. left 值-
className: string类名-
1.1.2

8 months ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago