Skip to main content
Version: Next

Details Header

Details Header Gif

Example usage

Check out DetailsHeader examples for ScrollView, FlatList, SectionList & FlashList

const DetailsHeaderScrollViewExample: React.FC = () => {
const navigation = useNavigation();

function goBack() {
navigation.goBack();
}

const isDarkTheme = useColorScheme() === 'dark';

return (
<>
<DetailsHeaderScrollView
leftTopIcon={iconCloseWhite}
leftTopIconOnPress={goBack}
rightTopIcon={IconMenu}
contentContainerStyle={[
isDarkTheme ? screenStyles.darkBackground : screenStyles.lightBackground,
]}
containerStyle={screenStyles.stretchContainer}
contentIcon={CardsBlack}
contentIconNumber={10}
backgroundColor={Brandon.color}
hasBorderRadius
image={Brandon.image}
tag={Brandon.type}
title={Brandon.author}
titleStyle={screenStyles.text}
showsVerticalScrollIndicator={false}>
<View style={styles.content}>
{Brandon.cards.map((data, i, arr) => (
<QuizCard data={data} num={i} key={data.question} cardsAmount={arr.length} />
))}
</View>
</DetailsHeaderScrollView>
<StatusBar barStyle="light-content" backgroundColor={Brandon.color} translucent />
</>
);
};

Props

DetailsHeaderScrollView props

Inherits ScrollViewProps and Shared DetailsHeader props

DetailsHeaderFlatList props

Inherits FlatListProps and Shared DetailsHeader props

DetailsHeaderFlatList props

Inherits SectionListProps and Shared DetailsHeader props

Shared DetailsHeader props

PropTypeDefault value
backgroundColorcolor - ColorValue-
backgroundImageimage source - ImageSourcePropType-
containerStylestyle - StyleProp<ViewStyle>-
contentIconimage source - ImageSourcePropType-
contentIconNumbernumber-
contentIconNumberStylestyle - StyleProp<TextStyle>-
contentIconNumberTestIDstring-
enableSafeAreaTopInsetbooleantrue
leftTopIconrender function or image source-
leftTopIconAccessibilityLabelstring-
leftTopIconOnPressfunction - () => void-
leftTopIconTestIDstring-
hasBorderRadiusboolean-
headerHeightnumber100
imageimage source - ImageSourcePropType-
onHeaderLayoutfunction - (e: LayoutChangeEvent) => void-
onMomentumScrollBeginworklet function - (e: NativeScrollEvent) => void-
onMomentumScrollEndworklet function - (e: NativeScrollEvent) => void-
onScrollworklet function - (e: NativeScrollEvent) => void-
onScrollBeginDragworklet function - (e: NativeScrollEvent) => void-
onScrollEndDragworklet function - (e: NativeScrollEvent) => void-
onTabsLayoutfunction - (e: LayoutChangeEvent) => void-
onTopReachedfunction - () => void-
parallaxHeightnumber53% of screen's height
renderHeaderBarrender function-
rightTopIconrender function or image source-
rightTopIconAccessibilityLabelstring-
rightTopIconOnPressfunction - () => void-
rightTopIconTestIDstring-
snapStartThresholdnumber-
snapStopThresholdnumber-
snapToEdgebooleantrue
stickyTabsbooleantrue
subtitlestring-
subtitleStylestyle - StyleProp<TextStyle>-
subtitleTestIDstring-
tabsContainerBackgroundColorcolor - ColorValue-
tagstring-
tagStylestyle - StyleProp<TextStyle>-
tagTestIDstring-
titlestring-
titleStylestyle - StyleProp<TextStyle>-
titleTestIDstring-