![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
expo-header
Advanced tools
The AppHeader
component is a customizable and animated header component designed for React Native applications. It supports dynamic titles, interactive buttons, and integrations with React Navigation.
react-native-reanimated
.To use the AppHeader
component in your project, ensure you have the following dependencies installed:
npm i expo-header
Please ensure that those packages are installed.
react-navigation @react-navigation/native react-native-reanimated
Here's an example of how to use the AppHeader
component in your project:
import React from "react";
import { View, Text } from "react-native";
import AppHeader from "expo-header";
const ExampleScreen = () => {
return (
<View style={{ flex: 1 }}>
<AppHeader
headerTitle="Home"
onLeftPress={() => console.log("Left button pressed!")}
onRightPress={() => console.log("Right button pressed!")}
leftIcon="menu"
rightIcon="notifications"
/>
<Text style={{ flex: 1, textAlign: "center", marginTop: 20 }}>
Welcome to the example screen!
</Text>
</View>
);
};
export default ExampleScreen;
Prop Name | Type | Default Value | Description |
---|---|---|---|
headerTitle | string | Current route | Title of the header. If not provided, the current route name is used. |
onLeftPress | () => void | Opens drawer | Function to execute when the left button is pressed. |
onRightPress | () => void | Alerts a message | Function to execute when the right button is pressed. |
leftIcon | string | "menu" | Icon name for the left button. |
rightIcon | string | undefined | Icon name for the right button. |
leftIconFamily | string | "MaterialIcons" | Icon family for the left button. |
rightIconFamily | string | "MaterialIcons" | Icon family for the right button. |
leftIconSize | number | 28 | Size of the left button icon. |
rightIconSize | number | 28 | Size of the right button icon. |
leftIconColor | string | "#007AFF" | Color of the left button icon. |
rightIconColor | string | "#007AFF" | Color of the right button icon. |
LeftComponent | React.Component | undefined | Custom component for the left side. Overrides leftIcon props. |
RightComponent | React.Component | undefined | Custom component for the right side. Overrides rightIcon props. |
headerStyle | ViewStyle | {} | Style for the header container. |
leftPressDisable | boolean | false | Disables the left button interaction. |
rightPressDisable | boolean | false | Disables the right button interaction. |
You can override any default styles by providing your own styles through the headerStyle
, leftIconStyle
, rightIconStyle
, or titleStyle
props.
<AppHeader
headerTitle="Profile"
headerStyle={{ backgroundColor: "#f8f8f8", elevation: 5 }}
titleStyle={{ color: "#333", fontWeight: "bold" }}
/>
The AppHeader
uses react-native-reanimated
to provide smooth press animations for its buttons. Customize these animations in the AnimatedTouchable
component if needed.
This package is open-sourced under the MIT License. Feel free to use and modify it as per your needs.
Contributions are welcome! Feel free to submit issues or pull requests to enhance the functionality of this package.
react-native-reanimated
.react-native-vector-icons
package.FAQs
A full functional Header for React Native
We found that expo-header demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.