Skip to content

Conversation

@lodev09
Copy link
Owner

@lodev09 lodev09 commented Nov 26, 2025

Add Native Header View Component

This PR introduces a native Header component that allows rendering content at the top of the sheet that remains fixed while the sheet content scrolls. The header height is now included in auto detent calculations for accurate sheet sizing.

Features

  • Native Header View: New TrueSheet.Header component for fixed header content
  • Auto Detent Calculation: Header height is now factored into auto detent sizing on both iOS and Android
  • ViewProps Support: Sheet now accepts all ViewProps for better customization

Bug Fixes

iOS

  • Properly re-pin scroll view when header changes
  • Move state update to didLayoutSubviews for more accurate size reporting

Android

  • Fix sheet reconfiguration when header size changes dynamically
  • Fix footer touch events when sheet is fully expanded to full height
  • Fix proper container height calculation
  • Fix proper ...rest props spreading
  • Add immediate state update with screen width on initialization
  • Better content height lifecycle management

Documentation

  • Add header usage guide
  • Move scrolling caution to troubleshooting section
  • Add minHeight workaround for Android ScrollView drag issues
  • Update migration guide

Changes

Platform Files Changed
Android TrueSheetHeaderView.kt, TrueSheetHeaderViewManager.kt, TrueSheetContainerView.kt, TrueSheetViewController.kt, TrueSheetView.kt, ScreenUtils.kt
iOS TrueSheetHeaderView.h/mm, TrueSheetContainerView.h/mm, TrueSheetViewController.mm, TrueSheetView.mm, TrueSheetContentView.mm, LayoutUtil.mm
JS/TS TrueSheet.tsx, TrueSheet.types.ts, TrueSheetHeaderViewNativeComponent.ts
Docs header.mdx, scrolling.mdx, troubleshooting.mdx, migration.mdx, props.mdx

…lization

- Add getScreenWidth() utility method to ScreenUtils for consistent screen calculations
- Update TrueSheetView to immediately update state when stateWrapper is set
- Ensures initial container width is available before controller emits size changes
- Improves initial render performance and prevents layout shift
- Reset _lastStateSize in prepareForRecycle
- Updated example sheets
- Add TrueSheetHeaderView native component for iOS and Android
- Add header prop to TrueSheet component
- Subtract header height from container height in state for proper content layout
- Update documentation for header feature
@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-native-true-sheet Ready Ready Preview Comment Nov 26, 2025 3:22pm

- Add headerHeight property to TrueSheetViewController
- Include header height in totalHeight for auto detent calculation
- Implement containerViewHeaderDidChangeSize delegate in TrueSheetView
- Add headerHeight method to TrueSheetContainerView
- Simplify scroll view pinning by passing header view directly
- Re-apply scroll view pinning when header is added/removed
- Update TrueSheetHeaderView registration in package.json codegenConfig
- Update AGENTS.md with current project structure
- Simplify migration.mdx examples
- Rename pinScrollView to scrollViewPinningEnabled for clarity
- Track scrollViewPinningSet flag to handle header mount/unmount
- Re-apply scroll view pinning when header is mounted/unmounted
- Fix unpinView to remove constraints from parent view
- Call headerDidChangeSize delegate on header mount/unmount
@lodev09 lodev09 marked this pull request as ready for review November 26, 2025 15:23
@lodev09 lodev09 merged commit 7d969d2 into main Nov 26, 2025
5 checks passed
@lodev09 lodev09 deleted the feat/add-header-prop branch November 26, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants