This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo 路由
Expo Router 子模块提供无头选项卡组件来创建自定义选项卡布局。
expo-router/ui 是 expo-router 的一个子模块,它导出无头组件和 hooks,用于构建 自定义标签布局。你可以用它来替代 Expo Router 自带的导航器,比如 JavaScript 标签 和 原生标签。
有关本地和网页应用文件路由库的更多信息,请参阅 Expo Router 参考。
安装
🌐 Installation
要在你的项目中使用 expo-router/ui,你需要在项目中安装 expo-router。请按照 Expo Router 的安装指南中的说明进行操作:
🌐 To use expo-router/ui in your project, you need to install expo-router in your project. Follow the instructions from the Expo Router's installation guide:
了解如何在项目中安装 Expo Router。
应用配置中的配置
🌐 Configuration in app config
如果你使用 default 模板创建新项目,expo-router 的 配置插件 已经在你的应用配置中设置好了。
🌐 If you are using the default template to create a new project, expo-router's config plugin is already configured in your app config.
Example app.json with config plugin
用法
🌐 Usage
有关在自定义标签布局指南中使用 expo-router/ui 的信息:
🌐 For information about using expo-router/ui in Custom tab layouts guide:
应用接口
🌐 API
import { Tabs, TabList, TabTrigger, TabSlot } from 'expo-router/ui';
No API data file found, sorry!