---
title: "PinnableContainer"
description: "Represents a container which can be pinned when the content of this container is important.

For example, each item of lazy list represents one [PinnableContainer], and if this container is
pinned, this item will not be disposed when scrolled out of the viewport.

Pinning a currently focused item so the focus is not lost is one of the examples when this
functionality can be useful."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface PinnableContainer
```


Represents a container which can be pinned when the content of this container is important.

For example, each item of lazy list represents one `PinnableContainer`, and if this container is
pinned, this item will not be disposed when scrolled out of the viewport.

Pinning a currently focused item so the focus is not lost is one of the examples when this
functionality can be useful.


## Functions

```kotlin
fun pin(): PinnedHandle
```


Allows to pin this container when the associated content is considered important.

For example, if this `PinnableContainer` is an item of lazy list pinning will mean this item
will not be disposed when scrolled out of the viewport.

Don't forget to call `PinnedHandle.release` when this content is not important anymore.



