Header
Headers are navigation components that display information and actions relating to the current screen.
Note:
Make sure that you have completed Step 3 in the setup guide before using Header
.
#
UsageNote:
Make sure that you have completed Step 3 in the setup guide before using Header
.
Headers are navigation components that display information and actions relating to the current screen.
#
LinearGradient UsageUsing LinearGradient in React Native Elements is supported through the
react-native-linear-gradient
package. If you're using expo or create-react-native-app then you can use
linearGradientProps
prop right out the box with no additional setup.
For react-native-cli users, make sure to follow the installation instructions and use it like this:
import { Header } from 'react-native-elements';import LinearGradient from 'react-native-linear-gradient';
...
<Header ViewComponent={LinearGradient} // Don't forget this! linearGradientProps={{ colors: ['red', 'pink'], start: { x: 0, y: 0.5 }, end: { x: 1, y: 0.5 }, }}/>
#
Props#
Header- ViewComponent
- backgroundColor
- backgroundImage
- backgroundImageStyle
- barStyle
- centerComponent
- centerContainerStyle
- children
- containerStyle
- elevated
- leftComponent
- leftContainerStyle
- linearGradientProps
- placement
- rightComponent
- rightContainerStyle
- statusBarProps
#
Reference#
Header#
ViewComponentComponent for container.
Type | Default |
---|---|
React Component | ImageBackground or View Component |
#
backgroundColorSets backgroundColor of the parent component.
Type | Default |
---|---|
string | None |
#
backgroundImageSets backgroundImage for parent component.
Type | Default |
---|---|
ImageSourcePropType | None |
#
backgroundImageStyleStyling for backgroundImage in the main container.
Type | Default |
---|---|
ImageStyle | None |
#
barStyleSets the color of the status bar text.
Type | Default |
---|---|
StatusBarStyle | None |
#
centerComponentDefine your center component here.
Type | Default |
---|---|
any | None |
#
centerContainerStyleStyling for container around the centerComponent.
Type | Default |
---|---|
View style(Object) | None |
#
childrenAdd children component to the header.
Type | Default |
---|---|
(Element or Element[]) and ReactNode | [] |
#
containerStyleStyling around the main container.
Type | Default |
---|---|
View style(Object) | None |
#
elevatedElevation for header
Type | Default |
---|---|
boolean | None |
#
leftComponentDefine your left component here.
Type | Default |
---|---|
any | None |
#
leftContainerStyleStyling for container around the leftComponent.
Type | Default |
---|---|
View style(Object) | None |
#
linearGradientPropsDisplays a linear gradient. See usage.
Type | Default |
---|---|
Object | None |
#
placementAlignment for title.
Type | Default |
---|---|
"center" or "left" or "right" | center |
#
rightComponentDefine your right component here.
Type | Default |
---|---|
any | None |
#
rightContainerStyleStyling for container around the rightComponent.
Type | Default |
---|---|
View style(Object) | None |
#
statusBarPropsAccepts all props for StatusBar.
Type | Default |
---|---|
StatusBarProps | None |