This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
基本警报对话框
一个用于显示自定义内容对话框的 Jetpack Compose BasicAlertDialog 组件。
Android
Included in Expo Go
Expo UI BasicAlertDialog 与官方 Jetpack Compose BasicAlertDialog API 一致,并显示一个可接受自定义子组件作为内容的最简对话框,让你可以完全控制对话框布局。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
带自定义内容的基础对话框
BasicAlertDialogExample.tsx
API
import { BasicAlertDialog } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<BasicAlertDialogProps>
A basic alert dialog that provides a blank container for custom content.
Unlike AlertDialog, this component does not have structured title/text/buttons slots.
Optional • Type:
() => voidCallback that is called when the user tries to dismiss the dialog (e.g. by tapping outside of it or pressing the back button).