# AI Guide for @ouidesigner/ouider-native-ui

Use this file when an AI coding agent adds native UI interactions to an Ouider mini app.

## Usage

Install the module on the default bridge:

```ts
import '@ouidesigner/ouider-native-ui'
```

Use `OUID.ui` for native host UI:

```ts
await OUID.ui.toast('Saved')

const loading = await OUID.ui.loading.show('Loading...')
await loading.update('Almost done...')
await loading.hide()

const confirmed = await OUID.ui.confirm({
  title: 'Delete item?',
  message: 'This cannot be undone',
  confirmText: 'Delete',
  destructive: true
})
```

## Rules

- Prefer native UI for short host-level feedback: toast, loading, alert, confirm, prompt, and action sheet.
- Keep loading overlays short-lived. Always hide a loading handle in a `finally` block when possible.
- Do not use native loading for routine background work that can be represented inline.
- For destructive actions, use `confirm` with `destructive: true`.
- For multiple choices, use `sheet` with stable action ids.

## Manifest

Native UI helpers usually do not need a dedicated manifest permission. If the UI action triggers another native capability, declare the capability permission separately.

## Example Pattern

```ts
const loading = await OUID.ui.loading.show('Saving...')
try {
  await saveData()
  await OUID.ui.toast('Saved')
} catch (error) {
  await OUID.ui.alert({ title: 'Save failed', message: String(error) })
} finally {
  await loading.hide()
}
```

