Gathering detailed insights and metrics for react-native-head-tab-view-expand
Gathering detailed insights and metrics for react-native-head-tab-view-expand
Gathering detailed insights and metrics for react-native-head-tab-view-expand
Gathering detailed insights and metrics for react-native-head-tab-view-expand
Add collapsible headers to your tab-view components.
npm install react-native-head-tab-view-expand
Typescript
Module System
Node Version
NPM Version
TypeScript (87.54%)
Java (5.02%)
Objective-C (3.41%)
JavaScript (1.93%)
Starlark (1.48%)
Ruby (0.63%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
444 Stars
100 Commits
82 Forks
5 Watchers
2 Branches
1 Contributors
Updated on Jun 27, 2025
Latest Version
4.0.0-rc.15
Package Id
react-native-head-tab-view-expand@4.0.0-rc.15
Unpacked Size
76.87 kB
Size
15.43 kB
File Count
11
NPM Version
8.4.1
Node Version
17.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
:tada::tada::tada: v4.0.0-rc.12 has been released, I hope you can help me test and collect questions.
In this version, there is a big change. All animations will run on the UI thread, which will make the components much smoother. Unfortunately, the version requiring React Native is greater than 0.62.0. Because we rely on react-native-reanimated2.0
, that's what it requires.
Here are some changes and optimizations. Disruptive Changes:
makeHeaderHeight
and change it to headerHeight
It's not mandatory, but it would be nice if you did
SlideAnimated
modethis mode was used for ScrollView/FlatList scrolling stalling when dragging headers, no longer needed.
- Remove the scene's
refreshHeight
property
Both the TabView and Scene used to have the refreshHeight property. Now I think they are duplicate, just set refreshHeight on the TabView, its default value is 80
HPageViewHoc
has changed1# Past usage: 2import { HPageViewHoc } from 'react-native-head-tab-view' 3const HScrollView = HPageViewHoc(ScrollView) 4const HFlatList = HPageViewHoc(FlatList) 5const HSectionList = HPageViewHoc(SectionList) 6# Current usage 7import { HScrollView,HFlatList,HSectionList } from 'react-native-head-tab-view'
The following components are currently supported:
react-native-scrollable-tab-view
react-native-tab-view
For detailed usage, please refer to Example and Installation.
renderScrollHeader
can accept ReactElement.enableSnap
to props. (If it is true,it automatically switches to the folded and expanded states.)1.react-native-gesture-handler
2.react-native-reanimated
dependencies:
1.react-native-gesture-handler
dependencies:
1.react-native-gesture-handler
2.@react-native-community/viewpager
If your tabs component is react-native-scrollable-tab-view
1import * as React from 'react'; 2import { View } from 'react-native'; 3import { HScrollView } from 'react-native-head-tab-view' 4import { CollapsibleHeaderTabView } from 'react-native-scrollable-tab-view-collapsible-header' 5export default class ExampleBasic extends React.PureComponent<any> { 6 render() { 7 return ( 8 <CollapsibleHeaderTabView renderScrollHeader={() => <View style={{ height: 200, backgroundColor: 'red' }} />}> 9 <HScrollView index={0}> 10 <View style={{ height: 1000, backgroundColor: '#ff4081' }} /> 11 </HScrollView> 12 <HScrollView index={1}> 13 <View style={{ height: 1000, backgroundColor: '#673ab7' }} /> 14 </HScrollView> 15 </CollapsibleHeaderTabView> 16 ) 17 } 18}
If your tabs component is react-native-tab-view
1import * as React from 'react'; 2import { View, StyleSheet, Dimensions } from 'react-native'; 3import { SceneMap } from 'react-native-tab-view'; 4import { HScrollView } from 'react-native-head-tab-view' 5import { CollapsibleHeaderTabView } from 'react-native-tab-view-collapsible-header' 6 7const FirstRoute = () => ( 8 <HScrollView index={0}> 9 <View style={[styles.scene, { backgroundColor: '#ff4081' }]} /> 10 </HScrollView> 11); 12 13const SecondRoute = () => ( 14 <HScrollView index={1}> 15 <View style={[styles.scene, { backgroundColor: '#673ab7' }]} /> 16 </HScrollView> 17); 18 19const initialLayout = { width: Dimensions.get('window').width }; 20 21export default function TabViewExample() { 22 const [index, setIndex] = React.useState(0); 23 const [routes] = React.useState([ 24 { key: 'first', title: 'First' }, 25 { key: 'second', title: 'Second' }, 26 ]); 27 28 const renderScene = SceneMap({ 29 first: FirstRoute, 30 second: SecondRoute, 31 }); 32 33 return ( 34 <CollapsibleHeaderTabView 35 renderScrollHeader={() => <View style={{ height: 200, backgroundColor: 'red' }} />} 36 navigationState={{ index, routes }} 37 renderScene={renderScene} 38 onIndexChange={setIndex} 39 initialLayout={initialLayout} 40 /> 41 ); 42} 43 44const styles = StyleSheet.create({ 45 scene: { 46 flex: 1, 47 }, 48});
More examples:Example
1cd Example 2yarn or npm install 3 4//run Android 5react-native run-android 6 7//run iOS 8cd ios 9pod install 10cd ../ 11react-native run-ios
1yarn add react-native-head-tab-view react-native-gesture-handler react-native-reanimated 2or 3npm install react-native-head-tab-view react-native-gesture-handler react-native-reanimated --save
yarn add react-native-scrollable-tab-view-collapsible-header
yarn add react-native-tab-view-collapsible-header
react-native-head-tab-view | react-native-scrollable-tab-view-collapsible-header | react-native-tab-view-collapsible-header |
---|---|---|
v1 ~ v2 | - | - |
v3 | v0 | v0 |
v4-rc.1 | v1 | v1 |
v4-rc.2~ | v2 | v2 |
You need to add this dependency library
1import { CollapsibleHeaderTabView } from 'react-native-scrollable-tab-view-collapsible-header'
- If your tabs component is react-native-tab-view
>You need to add [this dependency library](https://github.com/zyslife/react-native-tab-view-collapsible-header)
```js
import { CollapsibleHeaderTabView } from 'react-native-tab-view-collapsible-header'
CollapsibleHeaderTabView
extends the props for the tabs component by adding the CollapsibleHeaderProps
renderScrollHeader
(React.ComponentTyperender the collapsible header
1renderScrollHeader={()=><View style={{height:180,backgroundColor:'red'}}/>}
headerHeight
(optional)The height of collapsible header.
tabbarHeight
(optional)The height of collapsible tabbar
frozeTop
The height at which the top area of the Tabview is frozen
overflowHeight
Sets the upward offset distance of the TabView and TabBar
makeScrollTrans
(scrollValue: Animated.ShareValueGets the animation value of the shared collapsible header.
1<CollapsibleHeaderTabView 2 makeScrollTrans={(scrollValue) => { 3 this.setState({ scrollValue }) 4 }} 5/>
onStartRefresh
(() => void)If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality.
Make sure to also set the isRefreshing prop correctly.
isRefreshing
(boolean)Whether the TabView is refreshing
renderRefreshControl
(() => React.ReactElement)A custom RefreshControl
scrollEnabled
(boolean)Whether to allow the scene to slide vertically
refreshHeight
(number)If this height is reached, a refresh event will be triggered (onStartRefresh)
it defaults to 80
overflowPull
(number)It's the distance beyond the refreshHeight, the distance to continue the displacement, when the pull is long enough,
it defaults to 50.
pullExtendedCoefficient
(number)When the maximum drop-down distance is reached(refreshHeight+overflowPull), the refreshControl moves the distance for each pixel the finger moves The recommended number is between 0 and 1.
index
(number) (require)The number of the screen.
If you use react-native-scrollable-tab-view, it should correspond to the number of the children
element in the TabView.
If you use react-native-tab-view, it should correspond to the index of the navigationState
of the TabView
Please check the Example .
onStartRefresh
(() => void)If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality.
Make sure to also set the isRefreshing prop correctly.
isRefreshing
(boolean)Whether the scene is refreshing
renderRefreshControl
(() => React.ComponentTypeA custom RefreshControl for scene
renderLoadingView
((headerHeight: number) => React.ReactElement)You can provide a LoadingView when the scene is transparent until the height of the onContentSizeRange callback is less than minHeight.
enableSnap
(boolean)When it stops sliding, it automatically switches to the folded and expanded states.
React-Native-Reanimated2.0
when you first start using V4.Refer to the official documentation. I'm sure it won't be difficult for you
Thank you for your effort.
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
binaries present in source code
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More