A form sheet is a modal that rises from the bottom and can stop partway up, which keeps the screen behind it in view while the user picks a filter or fills in a short form. The user drags it between resting heights you define, and you also decide which of those heights it opens at. Android draws it with its own bottom sheet, which accepts fewer heights and shows no header, so a sheet built and tested only on iOS can lose its title on Android.

Key terms

  • formSheet: the presentation value that shows a route as a bottom sheet the user can drag between detents.
  • Detent: a height where a sheet can rest.
  • sheetAllowedDetents: the screen option that lists a sheet's detents, as fractions of the screen height or the string 'fitToContents'.
  • sheetInitialDetentIndex: the screen option that picks the detent the sheet opens at, by its index in sheetAllowedDetents.

Detents are fractions of the screen height

Set presentation: 'formSheet' on the route's Stack.Screen and it opens as a sheet. If you set nothing else, sheetAllowedDetents defaults to [1.0], a single detent at full height.

Each number in sheetAllowedDetents is a fraction from 0 to 1 of the screen height, and the option only has an effect with presentation: 'formSheet'. [0.4, 0.8] gives the sheet two resting points, at 40% and 80% of the screen. Write the values in ascending order. That rule is only checked in development, where an unsorted array throws an error, so a production build won't point the mistake out for you.

'fitToContents' in place of the array makes the sheet size itself to its content. The sheet then needs to know how big that content really is, so give it explicit dimensions, because flex: 1 is not supported with this setting. With numeric detents, flex: 1 does work on iOS.

Picking the height it opens at

sheetInitialDetentIndex counts positions in the sheetAllowedDetents array, and its default, 0, means the first detent. Since the array is sorted, the first detent is also the smallest. The string 'last' opens the sheet at the last detent, which is the largest. An index past the end of the array throws in development, and in production it is reset to the default 0, so the sheet quietly opens at its smallest height.

A filter sheet over a map

The MapLayout example opens a filters route over a map of nearby places. With sheetAllowedDetents: [0.4, 0.8] and no sheetInitialDetentIndex, the sheet opens at 40% of the screen, and dragging it up stops at 80%. Changing the opening height to the larger detent takes one more line, sheetInitialDetentIndex: 'last'.

Two more options shape how the sheet sits on the map:

  • sheetGrabberVisible: true shows a grabber handle at the top of the sheet. It is iOS only and defaults to false.
  • sheetLargestUndimmedDetentIndex is the largest detent index with no dimming view under the sheet. It defaults to 'none', which always dims. With 0, the map stays undimmed while the sheet rests at 40%, and dims once the user drags it to 80%.

sheetCornerRadius sets the sheet's corner radius when you give it a non-negative number. Any other value, or no value, keeps the system default.

What changes on Android

Android form sheets use the platform's bottom sheet. Android uses at most the first three values of sheetAllowedDetents and ignores the rest, while iOS accepts any number of detents.

Native stack headers and nested stacks are not supported inside a form sheet on Android, so headerShown, title and header buttons don't render in the sheet. Put the title and actions in the screen's own content, as the FiltersScreen example does with a Text heading above its switch. For a control that must stay visible at every height, unstable_sheetFooter adds a footer that remains on screen at every detent. It is Android only and experimental, so it may change in a future release.

Code Examples

tsx
import { Stack } from 'expo-router';

export default function MapLayout() {
  return (
    <Stack>
      <Stack.Screen name="index" options={{ title: 'Nearby' }} />
      <Stack.Screen
        name="filters"
        options={{
          presentation: 'formSheet',
          sheetAllowedDetents: [0.4, 0.8],
          sheetGrabberVisible: true,
          sheetLargestUndimmedDetentIndex: 0,
        }}
      />
    </Stack>
  );
}
tsx
import { useState } from 'react';
import { StyleSheet, Switch, Text, View } from 'react-native';

export default function FiltersScreen() {
  const [openNow, setOpenNow] = useState(false);

  return (
    <View style={styles.sheet}>
      {/* The heading is content: Android form sheets render no header or title */}
      <Text style={styles.heading}>Filters</Text>
      <View style={styles.row}>
        <Text>Open now</Text>
        <Switch value={openNow} onValueChange={setOpenNow} />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  sheet: { flex: 1, padding: 20, gap: 16 },
  heading: { fontSize: 20, fontWeight: '600' },
  row: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },
});
✓ Completed