Skip to main content
Version: Next

Avatar Header

Avatar Header Gif

Example usage

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

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

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

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

return (
<>
<AvatarHeaderScrollView
leftTopIcon={iconCloseWhite}
leftTopIconOnPress={goBack}
rightTopIcon={IconMenu}
contentContainerStyle={[
isDarkTheme ? screenStyles.darkBackground : screenStyles.lightBackground,
]}
containerStyle={screenStyles.stretchContainer}
backgroundColor={Brandon.color}
hasBorderRadius
image={Brandon.image}
subtitle={Brandon.about}
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>
</AvatarHeaderScrollView>
<StatusBar barStyle="light-content" backgroundColor={Brandon.color} translucent />
</>
);
};

Props

AvatarHeaderScrollView props

Inherits ScrollViewProps and Shared AvatarHeader props

AvatarHeaderFlatList props

Inherits FlatListProps and Shared AvatarHeader props

AvatarHeaderFlatList props

Inherits SectionListProps and Shared AvatarHeader props

Shared AvatarHeader props

PropTypeDefault value
backgroundColorcolor - ColorValue-
backgroundImageimage source - ImageSourcePropType-
containerStylestyle - StyleProp<ViewStyle>-
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-
titlestring-
titleStylestyle - StyleProp<TextStyle>-
titleTestIDstring-