@orionarm/react-native-collapse-tabs 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +32 -8
  2. package/package.json +38 -10
package/README.md CHANGED
@@ -1,8 +1,18 @@
1
1
  # @orionarm/react-native-collapse-tabs
2
2
 
3
- > A lightweight, performant collapsible-tabs component for React Native, built on top of [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) and [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) v3.
3
+ [![npm version](https://img.shields.io/npm/v/@orionarm/react-native-collapse-tabs.svg?style=flat-square)](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@orionarm/react-native-collapse-tabs.svg?style=flat-square)](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
5
+ [![license](https://img.shields.io/npm/l/@orionarm/react-native-collapse-tabs.svg?style=flat-square)](./LICENSE)
6
+ [![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20Android-blue?style=flat-square)]()
7
+ [![types](https://img.shields.io/npm/types/@orionarm/react-native-collapse-tabs.svg?style=flat-square)](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
4
8
 
5
- > ⚠️ **Work in Progress** APIs may still change before `1.x` is considered stable.
9
+ > A high-performance **React Native collapsible tabs** component with **sticky / animated header**, **swipeable pages**, and **per-tab scroll state**. Built on [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) and [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) v3.
10
+
11
+ ## Preview
12
+
13
+ <p align="center">
14
+ <img src="https://assets.syft.ai/repository/collapse-tabs.gif" alt="collapse-tabs demo" width="320" />
15
+ </p>
6
16
 
7
17
  ---
8
18
 
@@ -12,7 +22,9 @@
12
22
  - 🗂 **Swipeable tabs** — horizontal paging powered by `react-native-pager-view`.
13
23
  - 🎚 **Per-tab scroll state** — each tab keeps its own scroll position.
14
24
  - 🪄 **Animated tab switching** — header smoothly tweens between tabs (no sudden jumps).
25
+ - 🛡 **Overscroll-safe** — pull-to-refresh / bounce area won't push the header off screen.
15
26
  - 🎨 **Custom header & tab bar** — bring your own UI, or use the built-in `DefaultTabBar`.
27
+ - 🪝 **`onScroll` passthrough** — wrapped lists still forward your own scroll handler (worklet or JS).
16
28
  - ⚡ **Reanimated 3 worklets** — animations run on the UI thread for 60fps.
17
29
  - 🧩 **Drop-in scrollables** — wrapped `FlatList` / `ScrollView` handle the plumbing for you.
18
30
 
@@ -158,13 +170,26 @@ Wraps a single tab's content. Should be a direct child of `<CollapseTabs>`.
158
170
 
159
171
  Drop-in replacements for the standard components, pre-wired to the collapse-tabs scroll system.
160
172
 
161
- | Prop | Type | Required | Description |
162
- | ------ | -------- | -------- | ------------------------------------------------------ |
163
- | `name` | `string` | ✅ | Must match the parent `<Tab name="..." />`. |
164
- | ... | | | All other standard `FlatList` / `ScrollView` props. |
173
+ | Prop | Type | Required | Description |
174
+ | ---------- | -------------------------------------- | -------- | --------------------------------------------------------------------------- |
175
+ | `name` | `string` | ✅ | Must match the parent `<Tab name="..." />`. |
176
+ | `onScroll` | `(event) => void` or Reanimated worklet | | Forwarded after the internal handler runs. Works with both JS and worklet handlers. |
177
+ | ... | — | | All other standard `FlatList` / `ScrollView` props. |
165
178
 
166
179
  > They automatically apply `paddingTop: headerHeight + tabBarHeight` to the content so your first item starts below the header.
167
180
 
181
+ ```tsx
182
+ // Custom onScroll still works — gets called after the header math runs.
183
+ <FlatList
184
+ name="Posts"
185
+ data={data}
186
+ renderItem={renderItem}
187
+ onScroll={(e) => {
188
+ console.log("user scroll y =", e.nativeEvent.contentOffset.y);
189
+ }}
190
+ />
191
+ ```
192
+
168
193
  ### `<DefaultTabBar />`
169
194
 
170
195
  A minimal built-in tab bar with a sliding underline indicator. Pass any custom UI through `renderTabBar` if you need something different.
@@ -234,11 +259,10 @@ import type {
234
259
 
235
260
  ## Roadmap
236
261
 
237
- - [ ] Pull-to-refresh integration
238
262
  - [ ] Dynamic header height
239
263
  - [ ] SectionList / horizontal-list support
240
264
  - [ ] Snap-to-collapse behavior
241
- - [ ] Example app & screenshots
265
+ - [ ] Example app
242
266
 
243
267
  ---
244
268
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orionarm/react-native-collapse-tabs",
3
- "version": "1.0.4",
4
- "description": "A React Native collapsible tabs component",
3
+ "version": "1.0.6",
4
+ "description": "A high-performance React Native collapsible tabs component with sticky/animated header, swipeable pages, and per-tab scroll. Built on react-native-pager-view and react-native-reanimated v3.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "scripts": {
@@ -12,21 +12,49 @@
12
12
  },
13
13
  "keywords": [
14
14
  "react-native",
15
+ "react-native-tabs",
16
+ "react-native-collapsible-tabs",
17
+ "react-native-sticky-header",
18
+ "react-native-pager-view",
19
+ "react-native-reanimated",
15
20
  "collapse",
16
- "tabs",
17
21
  "collapsible",
18
- "react-native-component",
19
- "react-component",
20
- "react-native",
21
- "ios",
22
- "android",
22
+ "tabs",
23
23
  "tab",
24
- "swipe",
24
+ "tab-view",
25
+ "tabbar",
26
+ "tab-bar",
27
+ "sticky-header",
28
+ "sticky",
29
+ "animated-header",
30
+ "parallax-header",
31
+ "scroll",
25
32
  "scrollable",
26
- "coverflow"
33
+ "swipe",
34
+ "swipeable",
35
+ "pager",
36
+ "pager-view",
37
+ "reanimated",
38
+ "ios",
39
+ "android",
40
+ "expo",
41
+ "flatlist",
42
+ "scrollview"
27
43
  ],
28
44
  "author": "yanan_orionarm",
29
45
  "license": "ISC",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/orion-arm-ai/react-native-collapse-tabs.git"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/orion-arm-ai/react-native-collapse-tabs/issues"
52
+ },
53
+ "homepage": "https://github.com/orion-arm-ai/react-native-collapse-tabs#readme",
54
+ "engines": {
55
+ "node": ">=16"
56
+ },
57
+ "sideEffects": false,
30
58
  "peerDependencies": {
31
59
  "react": ">=16.8.0",
32
60
  "react-native": ">=0.60.0",