๐ŸŽ‰ True Sheet 4.0 is out with a rewritten layout engine. Read the announcement ยท Migration guide
Guides

Peeking Content

Collapse the sheet to a compact peek that expands into full content.

Building a map-style sheet with a compact summary that expands into full content? The "peek" detent collapses the sheet down to just the essentials โ€” no manual height juggling needed.

The "peek" Detent

Add "peek" to your detents to get a collapsed size based on the measured header height, plus an absolute footer if provided โ€” a relative footer is laid out below the content, so it's pushed off-screen at peek and doesn't count.

const App = () => {
  return (
    <TrueSheet
      detents={['peek', 0.9]}
      initialDetentIndex={0}
      header={<BookingSummary />}
      footer={<SheetActions />}
      footerOptions={{ position: 'absolute' }}
    >
      <BookingDetails />
    </TrueSheet>
  )
}

The peek height automatically follows the measured header and footer sizes. When no header, absolute footer, or peeking content is provided, it falls back to a fixed height of 150.

Peeking Part of the Content

To include part of the content in the peek height, wrap it with the TrueSheetPeek component.

import { TrueSheet, TrueSheetPeek } from '@lodev09/react-native-true-sheet'

const App = () => {
  return (
    <TrueSheet detents={['peek', 0.9]} initialDetentIndex={0}>
      <TrueSheetPeek>
        <BookingSummary />
      </TrueSheetPeek>
      <BookingDetails />
    </TrueSheet>
  )
}

When collapsed, the sheet reveals everything from the top of the sheet through the bottom edge of TrueSheetPeek โ€” content padding and anything rendered above it count toward the height, while content below it stays hidden until the sheet is expanded.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ header               โ”‚ โ”€โ”
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚  โ”‚
โ”‚ โ”‚  TrueSheetPeek   โ”‚ โ”‚  โ”œโ”€ visible when collapsed
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚  โ”‚
โ”‚ footer               โ”‚ โ”€โ”˜
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ rest of the content  โ”‚ โ”€โ”€ hidden until expanded
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

TrueSheetPeek can be placed anywhere within the content โ€” the collapsed sheet simply reveals everything above it, including itself. A sheet can only have one peek component.

Since everything above it counts, an empty TrueSheetPeek works as a fold marker โ€” drop it between your existing views to mark where the collapsed sheet ends, no wrapping needed.

<TrueSheet detents={['peek', 0.9]} initialDetentIndex={0}>
  <BookingSummary />
  <TrueSheetPeek />
  <BookingDetails />
</TrueSheet>

Styling

TrueSheetPeek is a regular View โ€” style it like any other.

<TrueSheetPeek style={styles.summary}>
  <Text style={styles.title}>True Sheet</Text>
  <Text style={styles.subtitle}>The true native bottom sheet experience.</Text>
</TrueSheetPeek>

Note that only the content through its bottom edge counts โ€” a marginBottom on the peek itself is not included. If you want breathing room below the peek content while collapsed, use paddingBottom instead.

Safe Area

By default (insetAdjustment="automatic"), the bottom safe area inset is added to the peek height so the peek content clears the system navigation bar. Set insetAdjustment="never" if you're handling insets yourself.

Resizing

"peek" works like any other detent โ€” resize to it programmatically or listen for changes. See Detents.

sheet.current?.resize(0) // collapse back to peek

Platform Support

The "peek" detent and TrueSheetPeek are supported on iOS 16+, Android, and Web.

Edit on GitHub

On this page