# Screen

> Organism — orn-ui

> ⚠️ Requiere <UIProvider>: Este componente (como todos los de orn-ui) debe renderizarse dentro de un ancestro <UIProvider>, o lanza un error en runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Corre en Expo SDK 54, 55, 56 y 57, y en React Native puro >=0.81 con react >=19.1. Sin módulos nativos — funciona en Expo Go, sin prebuild.

## Instalación

Instala solo este componente (copia el código fuente a tu proyecto, sin dependencia npm)
```bash
npx orn-ui add screen
```

O instala el paquete completo e impórtalo
```tsx
pnpm add orn-ui
import { Screen } from 'orn-ui/screen';
```

Depende de: core (theme + icons)

## Variantes

### A typical screen — scrolls, respects the top safe area

```tsx
<View style={{ height: 160, borderRadius: 12, overflow: 'hidden' }}>
  <Screen edges={['top']}>
    <View style={{ gap: 8 }}>
      <Subtitle>Recent activity</Subtitle>
      <Body>Invoice #4821 was paid.</Body>
      <Body>Invoice #4820 is due in 3 days.</Body>
      <Body>Invoice #4819 was paid.</Body>
    </View>
  </Screen>
</View>
```

### scrollable={false} — for content that brings its own list

```tsx
<View style={{ height: 80, borderRadius: 12, overflow: 'hidden' }}>
  <Screen scrollable={false} edges={[]}>
    <Body>Turn scrolling off so it doesn’t fight with a nested List or Wizard.</Body>
  </Screen>
</View>
```

## Código completo del demo

```tsx
const variants: VariantDef[] = [
  {
    label: 'A typical screen — scrolls, respects the top safe area',
    content: (
      <View style={{ height: 160, borderRadius: 12, overflow: 'hidden' }}>
        <Screen edges={['top']}>
          <View style={{ gap: 8 }}>
            <Subtitle>Recent activity</Subtitle>
            <Body>Invoice #4821 was paid.</Body>
            <Body>Invoice #4820 is due in 3 days.</Body>
            <Body>Invoice #4819 was paid.</Body>
          </View>
        </Screen>
      </View>
    ),
  },
  {
    label: 'scrollable={false} — for content that brings its own list',
    content: (
      <View style={{ height: 80, borderRadius: 12, overflow: 'hidden' }}>
        <Screen scrollable={false} edges={[]}>
          <Body>Turn scrolling off so it doesn’t fight with a nested List or Wizard.</Body>
        </Screen>
      </View>
    ),
  },
];
return <VariantList variants={variants} />;
```

## Props

| Nombre | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `style?` | `ViewStyle` | — | — |
| `scrollable?` | `boolean` | true | — |
| `contentContainerStyle?` | `ViewStyle` | — | — |
| `edges?` | `ScreenEdge[]` | ['top', 'bottom'] | Qué insets de safe area aplicar. |
| `keyboardAvoiding?` | `boolean` | true | Compensa el teclado: en iOS con scroll lo hace el propio ScrollView, en otros casos un KeyboardAvoidingView. Ponelo en false cuando el contenido ya trae su propio scroller que maneja el teclado (Wizard, List, SearchList): las dos compensaciones se suman y el campo enfocado termina empujado fuera de pantalla. |
