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

# retainWebContent

## Functions summary

|---|---|
| `WebContent` | `@Composable @RequiresFeature(name = "WEB_CONTENT", enforcement = "androidx.web.WebFeature#isFeatureSupported") retainWebContent(block: WebContent.Builder.() -> Unit)` Creates and retains a `WebContent` instance across configuration changes and transient compositions, automatically `closing` it when retired. |

## Functions

### retainWebContent

Artifact: [androidx.web:web-compose](https://developer.android.com/jetpack/androidx/releases/web.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/web/compose/WebSurface.kt+function:retainWebContent)

```
@Composable
@RequiresFeature(name = "WEB_CONTENT", enforcement = "androidx.web.WebFeature#isFeatureSupported")
fun retainWebContent(block: WebContent.Builder.() -> Unit = {}): WebContent
```

Creates and retains a `WebContent` instance across configuration changes and transient compositions, automatically `closing` it when retired.

| Parameters |
|---|---|
| `block: WebContent.Builder.() -> Unit = {}` | configuration block applied to `WebContent.Builder` when creating the `WebContent` |

| Returns |
|---|---|
| `WebContent` | a retained `WebContent` instance |

| See also |
|---|---|
| `WebContent` |   |
| `WebSurface` |   |
| `WEB_CONTENT` |   |