> Documentation index: https://developer.android.com/reference/llms.txt

# rememberA2uiPreviewSurface

## Functions summary

|---|---|
| `A2uiSurfaceModel` | `@Composable rememberA2uiPreviewSurface( catalog: A2uiCatalog, jsonMessages: List<String> )` Creates and remembers an `A2uiSurfaceModel` from raw A2UI JSON messages for Compose `@Preview`s. |

## Functions

### rememberA2uiPreviewSurface

Artifact: [androidx.a2ui.compose:compose-ui-tooling-preview](https://developer.android.com/jetpack/androidx/releases/a2ui-compose.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/tooling/preview/A2uiPreview.kt+function:rememberA2uiPreviewSurface) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/a2ui-compose.md.txt#1.0.0-alpha03)

```
@Composable
fun rememberA2uiPreviewSurface(
    catalog: A2uiCatalog,
    jsonMessages: List<String>
): A2uiSurfaceModel
```

Creates and remembers an `A2uiSurfaceModel` from raw A2UI JSON messages for Compose `@Preview`s.

Creates a new `A2uiSurfaceModel` whenever `catalog` or `jsonMessages` changes and disposes of the previous one. The remembered surface is also disposed when this function leaves the composition.

| Parameters |
|---|---|
| `catalog: A2uiCatalog` | `A2uiCatalog` defining the components available to this surface |
| `jsonMessages: List<String>` | list of raw JSON protocol messages, which must include a `createSurface` message |

| Returns |
|---|---|
| `A2uiSurfaceModel` | remembered `A2uiSurfaceModel` |