This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

BasicAlertDialog

A Jetpack Compose BasicAlertDialog component for displaying dialogs with custom content.

Android
Included in Expo Go
Recommended version:
~56.0.26

Expo UI BasicAlertDialog matches the official Jetpack Compose BasicAlertDialog API and displays a minimal dialog that accepts custom children as its content, giving you full control over the dialog layout.

Material 3 basic alert dialog with custom contentMaterial 3 basic alert dialog with custom content

Installation

Terminal
- npx expo install @expo/ui
- yarn expo install @expo/ui
- pnpm expo install @expo/ui
- bun expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Basic dialog with custom content

BasicAlertDialogExample.tsx
import { useState } from 'react'; import { Host, BasicAlertDialog, Button, TextButton, Text, Surface, Column, Spacer, } from '@expo/ui/jetpack-compose'; import { padding, wrapContentWidth, wrapContentHeight, clip, height, align, Shapes, } from '@expo/ui/jetpack-compose/modifiers'; export default function BasicAlertDialogExample() { const [visible, setVisible] = useState(false); return ( <Host matchContents> <Button onClick={() => setVisible(true)}> <Text>Open dialog</Text> </Button> {visible && ( <BasicAlertDialog onDismissRequest={() => setVisible(false)}> <Surface tonalElevation={6} modifiers={[wrapContentWidth(), wrapContentHeight(), clip(Shapes.RoundedCorner(28))]}> <Column modifiers={[padding(16, 16, 16, 16)]}> <Text> This area typically contains the supportive text which presents the details regarding the Dialog's purpose. </Text> <Spacer modifiers={[height(24)]} /> <TextButton onClick={() => setVisible(false)} modifiers={[align('centerEnd')]}> <Text>Confirm</Text> </TextButton> </Column> </Surface> </BasicAlertDialog> )} </Host> ); }

API

import { BasicAlertDialog } from '@expo/ui/jetpack-compose';

No API data file found, sorry!