A flexible, customizable header component for React Native applications with interchangeable logo support
npm install @egintegrations/mobile-headerA flexible, customizable header component for React Native applications with interchangeable logo support.
- ✅ Interchangeable Logo: Easily swap logos via props
- ✅ Three-Section Layout: Left, center, and right content slots
- ✅ Safe Area Support: Automatic iOS status bar padding
- ✅ Customizable Styling: Colors, heights, shadows
- ✅ TypeScript: Full type safety
- ✅ Zero Dependencies: Only requires React Native core
- ✅ Helper Components: Includes BackButton and MenuButton
``bash`
npm install @egintegrations/mobile-header
or
`bash`
yarn add @egintegrations/mobile-header
`tsx
import { Header } from '@egintegrations/mobile-header';
function App() {
return (
/>
);
}
`
`tsx`
logoWidth={150}
logoHeight={50}
/>
`tsx
import { Header, BackButton, MenuButton } from '@egintegrations/mobile-header';
import { useNavigation } from '@react-navigation/native';
function Screen() {
const navigation = useNavigation();
return (
leftContent={
rightContent={
backgroundColor="#1E40AF"
/>
);
}
`
`tsx`
My App Name
}
backgroundColor="#059669"
/>
`tsx
import { TouchableOpacity, Text } from 'react-native';
rightContent={
}
/>
`
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| logo | ImageSourcePropType | undefined | Logo image source (local or remote) |logoWidth
| | number | 120 | Width of the logo image |logoHeight
| | number | 40 | Height of the logo image |centerContent
| | React.ReactNode | undefined | Custom content for center (replaces logo) |leftContent
| | React.ReactNode | undefined | Content for left side (back button, menu, etc.) |rightContent
| | React.ReactNode | undefined | Content for right side (profile, notifications, etc.) |backgroundColor
| | string | '#FFFFFF' | Background color of the header |height
| | number | 60 | Height of the header (excluding status bar) |includeStatusBarPadding
| | boolean | true | Add padding for iOS status bar |showShadow
| | boolean | true | Show bottom shadow/elevation |style
| | ViewStyle | undefined | Custom style for container |logoStyle
| | ImageStyle | undefined | Custom style for logo image |
`tsx
import { BackButton } from '@egintegrations/mobile-header';
color="#000000"
/>
`
`tsx
import { MenuButton } from '@egintegrations/mobile-header';
color="#000000"
/>
`
`tsx
import React from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import { Header, BackButton } from '@egintegrations/mobile-header';
export default function ProfileScreen({ navigation }) {
return (
logo={require('./assets/company-logo.png')}
logoWidth={140}
logoHeight={45}
// Left side - Back button
leftContent={
color="#1F2937"
/>
}
// Right side - Settings button
rightContent={
}
// Styling
backgroundColor="#F3F4F6"
height={65}
showShadow={true}
/>
{/ Your screen content /}
);
}
`
`tsx`
backgroundColor="transparent"
showShadow={false}
/>
`tsx`
backgroundColor="#1E3A8A"
showShadow={true}
/>
`tsx`
height={80}
logoHeight={60}
/>
- iOS: Automatically includes status bar padding
- Android: No status bar padding (controlled by includeStatusBarPadding)shadowColor
- Shadows: Uses on iOS, elevation` on Android
MIT
See CONTRIBUTING.md
- 📚 Documentation
- 🐛 Report Issues
- 💬 Discussions