Skip to content

feat: add TrueSheetPeek component#730

Open
lodev09 wants to merge 3 commits into
mainfrom
feat/peek-component
Open

feat: add TrueSheetPeek component#730
lodev09 wants to merge 3 commits into
mainfrom
feat/peek-component

Conversation

@lodev09

@lodev09 lodev09 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a new TrueSheetPeek wrapper component that marks part of the content as the sheet's peek content. Its natively-measured height is included in the peek detent height (along with the header and footer heights), so the collapsed size follows the actual content — no onLayout juggling.

<TrueSheet detents={['peek', 0.9]} initialDetentIndex={0}>
  <TrueSheetPeek>
    <BookingSummary />
  </TrueSheetPeek>
  <BookingDetails />
</TrueSheet>
  • New TrueSheetPeekView Fabric component (iOS/Android) that measures via native layout and reports to the sheet's detent calculator — no JS round trip
  • Registers with the nearest container: subtree search when content mounts (Fabric mounts bottom-up), self-attach walk-up for late mounts, detach on unmount
  • Peek detent height = header + peek + footer, 150 fallback unchanged
  • Web mirrors it via onLayout + context feeding the vaul snap point
  • Docs note that TrueSheetPeek belongs at the top of the content (the sheet reveals from the top; only its height is used)
  • MapScreen example now uses ['peek', 'auto', 1] with the heading as peek content

Type of Change

  • New feature

Test Plan

  • yarn typecheck, yarn lint, yarn test (44 passed)
  • Example app MapScreen on iOS/Android: initial present at peek detent sizes to header + heading, resizes live when peek content changes

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
react-native-true-sheet Ready Ready Preview, Comment Jul 11, 2026 8:38pm

Request Review

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.

1 participant