@orionarm/react-native-collapse-tabs 1.0.5 → 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.
- package/README.md +32 -8
- package/package.json +30 -10
package/README.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# @orionarm/react-native-collapse-tabs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
|
|
4
|
+
[](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[]()
|
|
7
|
+
[](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
|
|
4
8
|
|
|
5
|
-
>
|
|
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
|
|
162
|
-
|
|
|
163
|
-
| `name`
|
|
164
|
-
|
|
|
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
|
|
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
|
-
"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,18 +12,34 @@
|
|
|
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
|
-
"
|
|
19
|
-
"react-component",
|
|
20
|
-
"react-native",
|
|
21
|
-
"ios",
|
|
22
|
-
"android",
|
|
22
|
+
"tabs",
|
|
23
23
|
"tab",
|
|
24
|
-
"
|
|
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
|
-
"
|
|
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",
|
|
@@ -35,6 +51,10 @@
|
|
|
35
51
|
"url": "https://github.com/orion-arm-ai/react-native-collapse-tabs/issues"
|
|
36
52
|
},
|
|
37
53
|
"homepage": "https://github.com/orion-arm-ai/react-native-collapse-tabs#readme",
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=16"
|
|
56
|
+
},
|
|
57
|
+
"sideEffects": false,
|
|
38
58
|
"peerDependencies": {
|
|
39
59
|
"react": ">=16.8.0",
|
|
40
60
|
"react-native": ">=0.60.0",
|