Skip to content

Instantly share code, notes, and snippets.

@mikaoelitiana
Created August 29, 2018 20:40
Show Gist options
  • Save mikaoelitiana/7b416cdc5ac96ad0713cd54fd09691be to your computer and use it in GitHub Desktop.
Save mikaoelitiana/7b416cdc5ac96ad0713cd54fd09691be to your computer and use it in GitHub Desktop.
custom nav header with react-native-elements
import React, { Component } from 'react'
import { View, TextInput, Text } from 'react-native'
import { Header } from 'react-native-elements'
class MyScreen extends Component {
render () {
return (
<View>
<Header
leftComponent={{ icon: 'menu', color: '#fff' }}
centerComponent={
<View>
<TextInput
placeholder={'Search'}
style={{ width: 250, backgroundColor: "white", paddingHorizontal: 20, paddingVertical: 5 }}/>
</View>
}
rightComponent={{ icon: 'search', color: '#fff' }}
/>
<View>
<Text>Lorem ipsum...</Text>
</View>
</View>
)
}
}
export default MyScreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment