Skip to content

New Feature: Headers #104

Closed
Closed

Description

@shovel-kun

As stated in the React Navigation docs (6.x and 7.x), @react-navigation/bottom-tabs allows for headers to be displayed and configured alongside the screen content.

However, as @react-navigation/bottom-tabs is a JS implementation, so too are the headers.

Does react-native-bottom-tabs plan to support headers?

If so, there are two ways to approach this:

  1. Use the JS implementation of headers (simpler):
    • We can reuse the same implementation for headers as seen in BottomTabView.tsx.
    • Since we're using the same API as JS Bottom Tabs, headers should work the same way especially animations, etc.
    • However, we might want to make it clear that unlike the bottom tab, headers are JS implementation.
  2. Use native implementation of headers (harder)

Thoughts?

Activity

  1. okwasniewski commented on Oct 31, 2024

    @okwasniewski
    Collaborator

    Hey!

    Thanks for opening this issue, I think it's a valid feature request.

    I would prefer to keep this library native so I guess the only viable option is to add native headers support.

    SwiftUI should be fairly simple but Android needs a second native component to render the top bar.

    We can keep the options limited as JS tabs did.

  2. okwasniewski commented on Nov 1, 2024

    @okwasniewski
    Collaborator

    Small update:

    I got iOS to work with just few lines of code and it looks great!

    CleanShot.2024-11-01.at.15.18.30.mp4

    I will investigate what we need to support Android

  3. shovel-kun commented on Nov 1, 2024

    @shovel-kun
    ContributorAuthor

    Awesome!!! Is it able to animate when navigating? Bottom Tab Screen -> Another Screen?

  4. gunnartorfis commented on Nov 3, 2024

    @gunnartorfis

    Not sure if this is related, but would it be possible to add an option to completely hide the header, or at least add a background color to it?

    Screenshot 2024-11-03 at 12 17 48
  5. okwasniewski commented on Nov 3, 2024

    @okwasniewski
    Collaborator

    Not sure if this is related, but would it be possible to add an option to completely hide the header, or at least add a background color to it?

    Screenshot 2024-11-03 at 12 17 48

    Hey @gunnartorfis try with ignoresTopSafeArea then your view will stretch above it

  6. gunnartorfis commented on Nov 3, 2024

    @gunnartorfis

    @okwasniewski Thanks it works, not sure how I missed that

  7. okwasniewski commented on Nov 3, 2024

    @okwasniewski
    Collaborator

    @gunnartorfis Im thinking about making it the default in next release so that the initial experience is smoother 😄

  8. changed the title [-]Support `Header related options`?[/-] [+]New Feature: Headers[/+] on Nov 3, 2024
  9. a-eid commented on Nov 9, 2024

    @a-eid

    a much needed feature.

  10. okwasniewski commented on Dec 17, 2024

    @okwasniewski
    Collaborator

    I'm moving this to discussions because all feature requests will now be under the "Ideas 💡" tab in GitHub discussions.

  11. locked and limited conversation to collaborators on Dec 17, 2024
  12. converted this issue into a discussion #210 on Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions