Applies to every preview on the site.
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
import { Dialog } from "@/components/ui/dialog";Or add it with the CLI (installs any missing peers):
Usage
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| open / defaultOpen Controlled / uncontrolled visibility. | boolean | false |
| onOpenChange Called on scrim tap, back, Escape and actions. | (open: boolean) => void | — |
| variant Destructive adds a warning icon, a danger confirm and a warning haptic on open. The old "sheet" value is deprecated and renders as default. | "default" | "destructive" | "default" |
| tone Living icon in a halo above the title with a soft glow of its colour; success / warning open with a matching haptic. | "info" | "success" | "warning" | "danger" | — |
| appearance Pill buttons, or iOS full-width text buttons split by hairlines. | "modern" | "ios" | "modern" |
| title / description Heading and body copy. | string | — |
| prompt Adds a text field (a prompt dialog). Its text is passed to onConfirm / onPress; Return submits. | { defaultValue?, value?, onChangeText?, placeholder?, secureTextEntry?, keyboardType?, maxLength?, … } | — |
| error Error text under the field or description. | string | — |
| children Custom content above the actions. | ReactNode | — |
| actions Buttons. role: primary | default | destructive | cancel. onPress(value) may return a promise (spinner) or false (stays open and shakes). | { label, onPress?, role?, disabled? }[] | Cancel + Confirm |
| confirmLabel / cancelLabel Labels for the default buttons; cancelLabel null leaves a single button. | string / string | null | labels.continue (destructive: labels.delete) / labels.cancel |
| onConfirm / onCancel Handlers for the default buttons (onCancel also fires on scrim, back and Escape). | (value) => void | false | Promise · () => void | — |
| loading Spinner on the confirm button; other buttons and dismissal are disabled. | boolean | false |
| actionsLayout Two short buttons side by side, otherwise stacked with Cancel last. | "auto" | "row" | "stack" | "auto" |
| icon Custom node inside the halo, or false to hide it. | ReactNode | false | tone icon |
| dismissible Close on scrim tap, back and Escape. | boolean | true |
| haptics Warning on open for destructive dialogs, success for success, error on shake. | boolean | true |
| accent Colour of the primary action. | string | theme primary (accent in ios) |
| style Card style. | StyleProp<ViewStyle> | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
Customization
You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.
Design theme
Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).
Variants
Pick the Variants chip above the preview, or set variant=… — "default" | "destructive".
Style props
React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).
- variant
- "default" | "destructive" · default "default"Destructive adds a warning icon, a danger confirm and a warning haptic on open. The old "sheet" value is deprecated and renders as default.
- accent
- string · default theme primary (accent in ios)Colour of the primary action.
- style
- StyleProp<ViewStyle>Card style.
- className
- stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.
Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.
Behaviour & accessibility
- Motion
- The scrim fades in while the card springs to full size. A confirm that returns false keeps it open and shakes it.
- Reduced motion
- The card fades in without the scale spring, and the tone icon appears fully drawn instead of animating. The shake is skipped.
- Haptics
- A warning tick on open for destructive, warning and danger dialogs, success for the success tone, and an error buzz on shake.
- Screen readers
- The title is a header; destructive, warning and danger dialogs use the alert role. Buttons report disabled and busy, and the error text is a polite live region.
- Keyboard
- Escape closes it on web, and Return submits a prompt field.
Source
FAQ
How do I make a modal in React Native?
npx @expokit/cli@latest add dialog in your Expo or React Native project and it copies a ready-made modal into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Dialog work in Expo Go?
react-native-svg, expo-haptics) are all included in Expo Go.How do I add Dialog to my Expo app?
npx @expokit/cli@latest add dialog in your project. The CLI copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change.Is Dialog free?
Can I change how Dialog looks?
useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.