# Facepile

> Overlapping collaborator avatars with +N. A native Pyzed component for Python desktop GUIs, with a live preview, code examples and its API.

Source: https://albakore.github.io/pyzed/library/facepile/

:::tip[In plain words]
A row of overlapping avatars that shows who is here.
:::

Overlapping avatars of collaborators, as in the title bar of a collaborative editor. People beyond `max_shown` are grouped into `+N`.

`ui.facepile` · Category: [Data](https://albakore.github.io/pyzed/library/#data) · [Full reference →](https://albakore.github.io/pyzed/reference/ui/#facepile)

**Code:**

```python
pz.column([
    ui.facepile(["Ana", "Luis", "Kev", "Marta"]),
    ui.facepile(["Ana", "Luis", "Kev", "Marta", "Sam", "Jo", "Lee", "Max"], size=28, max_shown=4),
], spacing=16, align="center")
```

## When to use

- To show who is in a project, a call or a document without listing names.

## Usage

```python
import pyzed as pz
from pyzed import ui

pz.column([
    ui.facepile(["Ana", "Luis", "Kev", "Marta"]),
    ui.facepile(["Ana", "Luis", "Kev", "Marta", "Sam", "Jo", "Lee", "Max"], size=28, max_shown=4),
], spacing=16, align="center")
```

## Variants

:::note[About these captures]
Each capture is recorded by pyzed itself, off-screen at 2x, in One Dark or One Light to match this site's theme, and cropped to the component so it shows at its real size. The pointer hovers, presses or types into it; a component that does not react to the pointer cycles through a few themes. With reduced motion you see the first frame. Open **Code** under a capture to see the snippet that draws it; free names such as `on_save` stand for your own callbacks.
:::

### Options

```python
ui.facepile(["Ana", "Luis"])
```

```python
ui.facepile(["Ana", "Luis", "Kev", "Marta", "Sam"])
```

```python
ui.facepile(["Ana", "Luis", "Kev", "Marta", "Sam", "Jo", "Lee"], max_shown=3)
```

```python
ui.facepile(["Ana", "Luis", "Kev", "Marta"], size=32, overlap=10)
```

## Events

Facepile has no events of its own: it shows what you give it. Like every widget it also has the **18 common events** (`click`, `double_click`, `right_click`, `mouse_enter`, `drag`, `key_down`, `resize`…), attached with `.on(...)`: see [Events](https://albakore.github.io/pyzed/guides/events/) and [Events of every component](https://albakore.github.io/pyzed/library/events/).

## Properties and API

### `ui.facepile`

```python
facepile(people, *, size=22, overlap=6, max_shown=5, theme=None)
```

Overlapping collaborator avatars, as in the title bar of a collaborative editor. Those beyond `max_shown` are grouped into `+N`.

| Property | Default | Description |
| --- | --- | --- |
| `people` | *required* | Initials or names. |
| `size` | `22` | Size. |
| `overlap` | `6` | Overlap in pixels. |
| `max_shown` | `5` | How many to show. |
| `theme` | `None` | Theme to use instead of the current one (`pyzed.theme.current()`). |

[Full reference →](https://albakore.github.io/pyzed/reference/ui/#facepile)

## Related

- [Avatar](https://albakore.github.io/pyzed/library/avatar/): A round avatar with initials in a collaborator color.
- [Title bar](https://albakore.github.io/pyzed/library/title-bar/): The top bar with project and branch pickers.
