npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-collapsible-header-tab-view

v1.0.6

Published

不依赖 react-native-reanimated ,可吸顶的tab view

Downloads

475

Readme

react-native-collapsible-header-tab-view

不依赖 react-native-reanimated,可吸顶的 tab view 组件

license

特性

轻量级 - 不依赖 react-native-reanimated
🎯 高性能 - 优化的滚动性能
📱 吸顶效果 - 完整的粘性头部和标签栏支持
🔄 灵活 - 支持 FlatList、SectionList 和 ScrollView
TypeScript - 完整的类型支持

安装

npm install react-native-collapsible-header-tab-view
# or
yarn add react-native-collapsible-header-tab-view

依赖

本库依赖 react-native-pager-view, 确保您项目安装正确版本的pagerView

npm install react-native-pager-view

使用

基础示例

TabFlatListTabSectionListTabScrollView 可以在同一个 CollapsibleTabView 中混合使用,每个子组件对应一个 Tab 页。

import CollapsibleTabView, {
  TabFlatList,
  TabSectionList,
} from 'react-native-collapsible-header-tab-view';

const sections = [
  { title: 'A', data: ['Alice', 'Amy'] },
  { title: 'B', data: ['Bob', 'Ben'] },
];

export function App() {
  return (
    <CollapsibleTabView
      renderHeader={() => <HeaderComponent />}
      renderTabBar={(props) => <TabBarComponent {...props} />}
    >
      {/* Tab 1: FlatList */}
      <TabFlatList
        data={data}
        renderItem={({ item }) => <ItemComponent item={item} />}
        keyExtractor={(item) => item.id}
      />
      {/* Tab 2: SectionList */}
      <TabSectionList
        sections={sections}
        renderItem={({ item }) => <Text>{item}</Text>}
        renderSectionHeader={({ section }) => <Text>{section.title}</Text>}
        keyExtractor={(item, index) => item + index}
      />
    </CollapsibleTabView>
  );
}

Props

CollapsibleTabView

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | renderHeader | () => ReactNode | 必需 | 头部组件 | | renderTabBar | (props: TabBarProps) => ReactNode | 必需 | 标签栏组件 | | estimatedHeaderHeight | number | 0 | 预估头部高度 | | estimatedTabBarHeight | number | 0 | 预估标签栏高度 | | stickyEnabled | boolean | true | 是否启用吸顶效果 | | stickyTop | number | 0 | 吸顶距离顶部的距离 | | swipeEnabled | boolean | true | 是否启用滑动切换 | | initialTabIndex | number | 0 | 初始标签页索引 | | onTabChange | (index: number) => void | - | 标签页切换回调 | | onScroll | (scrollY: number) => void | - | 滚动回调 | | style | StyleProp<ViewStyle> | - | 容器样式 |

TabFlatList

继承所有 FlatList 的 Props。

| 属性 | 类型 | 说明 | |------|------|------| | data | T[] | 列表数据 | | renderItem | (info: { item: T, index: number }) => ReactNode | 列表项渲染函数 | | keyExtractor | (item: T, index: number) => string | 列表项 key |

TabSectionList

继承所有 SectionList 的 Props。

| 属性 | 类型 | 说明 | |------|------|------| | sections | SectionListData[] | 分组数据 | | renderItem | (info: { item: T, index: number, section: S }) => ReactNode | 列表项渲染函数 | | renderSectionHeader | (info: { section: S }) => ReactNode | 分组头部渲染函数 | | keyExtractor | (item: T, index: number) => string | 列表项 key |

Ref Methods

interface CollapsibleTabViewRef {
  scrollToTab(index: number, animated?: boolean): void;
  getActiveIndex(): number;
}

许可证

MIT

贡献

欢迎提交 Issue 和 Pull Request!

作者