# Modal

> Organism — orn-ui

> ⚠️ Requires <UIProvider>: This component (like every orn-ui component) must render inside a <UIProvider> ancestor, or it throws at runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Runs on Expo SDK 54, 55, 56 and 57, and on bare React Native >=0.81 with react >=19.1. No native modules — works in Expo Go, no prebuild.

## Installation

Install just this component (copies the source into your project, no npm dependency)
```bash
npx orn-ui add modal
```

Or install the whole package and import it
```tsx
pnpm add orn-ui
import { Modal } from 'orn-ui/modal';
```

Depends on: core (theme + icons), title, icon-button, pressable-scale, transition

## Variants

### full

```tsx
<>
  <Button title="Open full" onPress={() => setFull(true)} />
  <Modal visible={full} onClose={() => setFull(false)} title="Full">
    <Body>Slides up from the bottom and fills the screen.</Body>
  </Modal>
</>
```

### overlay

```tsx
<>
  <Button title="Open overlay" onPress={() => setOverlay(true)} />
  <Modal visible={overlay} onClose={() => setOverlay(false)} title="Overlay" variant="overlay">
    <Body>A centered card over a dimmed backdrop.</Body>
  </Modal>
</>
```

### fullScreen

```tsx
<>
  <Button title="Open fullScreen" onPress={() => setFullScreen(true)} />
  <Modal visible={fullScreen} onClose={() => setFullScreen(false)} title="Full screen" variant="fullScreen">
    <Body>Native fullScreen presentation on iOS.</Body>
  </Modal>
</>
```

## Full demo source

```tsx
const variants: VariantDef[] = [
  {
    label: 'full',
    content: (
      <>
        <Button title="Open full" onPress={() => setFull(true)} />
        <Modal visible={full} onClose={() => setFull(false)} title="Full">
          <Body>Slides up from the bottom and fills the screen.</Body>
        </Modal>
      </>
    ),
  },
  {
    label: 'overlay',
    content: (
      <>
        <Button title="Open overlay" onPress={() => setOverlay(true)} />
        <Modal visible={overlay} onClose={() => setOverlay(false)} title="Overlay" variant="overlay">
          <Body>A centered card over a dimmed backdrop.</Body>
        </Modal>
      </>
    ),
  },
  {
    label: 'fullScreen',
    content: (
      <>
        <Button title="Open fullScreen" onPress={() => setFullScreen(true)} />
        <Modal visible={fullScreen} onClose={() => setFullScreen(false)} title="Full screen" variant="fullScreen">
          <Body>Native fullScreen presentation on iOS.</Body>
        </Modal>
      </>
    ),
  },
];
return <VariantList variants={variants} />;
```

## Props

| Name | Type | Default | Description |
|---|---|---|---|
| `visible` | `boolean` | — | — |
| `onClose?` | `() => void` | — | — |
| `title?` | `string` | — | — |
| `closeAccessibilityLabel?` | `string` | Close | — |
| `footer?` | `ReactNode` | — | — |
| `containerStyle?` | `ViewStyle` | — | — |
| `contentStyle?` | `ViewStyle` | — | — |
| `variant?` | `'full' \| 'overlay' \| 'fullScreen'` | full | — |
| `scrollable?` | `boolean` | true | — |
