@appandflow/react-navigation-bottom-sheet

中文文档
1.1.2发布于 2025/11/11MITTypeScriptCommonJS零依赖近 30 天下载 1706

Bottom sheet component for React Navigation and Expo Router

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Running the examples
  4. API
  5. Navigation options
  6. Navigation helpers
  7. Contributing
  8. License

@appandflow/react-navigation-bottom-sheet

Bottom sheet navigator for React Navigation.

Can also work with Expo Router example

Integrates @gorhom/bottom-sheet with React Navigation.

Installation

yarn add @appandflow/react-navigation-bottom-sheet @react-navigation/native @gorhom/bottom-sheet

If you don't have those already, you will also need to install the @gorhom/bottom-sheet dependencies react-native-reanimated and react-native-gesture-handler.

Usage

import { createBottomSheetNavigator } from '@appandflow/react-navigation-bottom-sheet';

// ...

const BottomSheet = createBottomSheetNavigator();

<BottomSheet.Navigator
  // Default options
  screenOptions={{ snapPoints: ['60%', '90%'] }}
>
  {/* The first screen should be your app content */}
  <BottomSheet.Screen name="app" component={MyApp} />
  <BottomSheet.Screen name="firstSheet" component={FirstSheetComponent} />
  <BottomSheet.Screen
    name="secondSheet"
    component={SecondSheetComponent}
    // Can pass any prop from @gorhom/bottom-sheet's BottomSheetModal
    options={{ snapPoints: [200, '100%'], index: 1 }}
  />
</BottomSheet.Navigator>;

// ...

// Open like any regular react-navigation screen.
navigation.navigate('firstSheet', { id: 1 });

See the React Navigation example app or the Expo Router example under example/expo-router/app for full usage details.

Running the examples

  • yarn example:react-navigation – launches the classic React Navigation sample
  • yarn example:expo-router – launches the Expo Router sample

API

Navigation options

snapPoints

Array<string | number>;

Points for the bottom sheet to snap to, points should be sorted from bottom to top. It accepts array of number and string.

Defaults to ['66%'].

Other options

Most props from BottomSheetModal are exposed as navigation options. See the @gorhom/bottom-sheet website for full documentation.

Navigation helpers

Navigation helpers are available on the navigation object.

snapTo

(index: number) => void

Snaps the current sheet to index.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

版本与发布记录

@appandflow/react-navigation-bottom-sheet 共发布 3 个版本,首次发布于 2025/11/11;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.1.2latest2025/11/1111 个月前
1.1.12025/11/1111 个月前
1.1.02025/11/1111 个月前

关于 @appandflow/react-navigation-bottom-sheet 的常见问题

@appandflow/react-navigation-bottom-sheet 是什么?

Bottom sheet component for React Navigation and Expo Router

如何安装 @appandflow/react-navigation-bottom-sheet?

在项目目录运行 npm install @appandflow/react-navigation-bottom-sheet,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@gorhom/bottom-sheet(*)、@react-navigation/native(*)、react(*)、react-native(*)、react-native-safe-area-context(*)、react-native-screens(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@appandflow/react-navigation-bottom-sheet 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@appandflow/react-navigation-bottom-sheet 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@appandflow/react-navigation-bottom-sheet 可以商用吗?

@appandflow/react-navigation-bottom-sheet 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@appandflow/react-navigation-bottom-sheet 的下载量有多少?

根据 npm 官方下载统计,@appandflow/react-navigation-bottom-sheet 在 2026/10/07 – 2026/11/05 这 30 天内被下载 1,706 次,日均约 57 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@appandflow/react-navigation-bottom-sheet 还在维护吗?

最新版本 1.1.2 发布于 2025/11/11(11 个月前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/11/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。