Default Image

Header

Header component.

import { Header } from "@redshank/native";

Examples

Default

Default header element.

Scroll Effect

Scroll animation in header, manipulation title, color, background, etc.

Using context

Using `useHeaderNavigation` for set props to header values.

APIs

Api props

AttributeTypeAccepted valuesDescriptionDefault
backgroundThemeColor stringThemeColorBackground header in static statebackground
backgroundStickyThemeColor stringThemeColorBackground header when apply animation scrollbackground prop
heightDynamicnumberNumberHeight where the scroll animation will begin to be applied0
leftIconReactNodeReact ElementOptional icon or element left-
statusBarHeightnumberNumberStatus bar height, by default it is calculated based on safe area and OScalculated
rightIconReactNodeReact ElementOptional icon or element right-
styleStyleProp<ViewStyle>objectStyle object for wrapper children element-
titleReactNode stringReactNode TextRequired. Title to header-
titleOnScrollReactNode stringReactNode TextTitle to header when make scroll animation-
titleOnScrollPositionTitlePositionTitlePositionPosition for title when scroll is appliedcenter
titlePositionTitlePositionTitlePositionPosition for title when header is initial or staticiOS: center Other: left
titleStyleStyleProp<TextStyle>objectStyle object for title prop-

useHeaderNavigation

Api props for useHeaderNavigation() hook, useful to use a single header component and change it according to your screen

AttributeTypeAccepted valuesDescriptionDefault
setValues(values: HeaderProps or null) => void;HeaderPropsChange context value for set values to header-
headerHeaderProps nullHeaderPropsSome header propsnull

Title Position

type TitlePosition = 'left' | 'center' | 'right';

Community:

We're excited to see the community adopt @redshank/native, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!

DiscordGithub

Contributing:

PR's on @redshank/native are always welcome, please see our contribution guidelines to learn how you can contribute to this project.

Copyright © 2023 @redshank.