# Add a Popover Section

> Keep occasional controls behind one trigger button that unfolds a temporary panel, and control it from other buttons.

Buttons doesn't make you choose between a clean layout and having everything available: a Popover keeps rarely-used controls one tap away without cluttering the canvas the rest of the time. This page covers creating a Popover, customizing how it opens and where it appears, and controlling it from elsewhere in the position.

## Before you begin

[Create a position](/docs/buttons/v1.10/positions/create-a-position) to add the Popover to.

## Create a Popover

1. Select the cell where you want the Popover's trigger button.

![A single canvas cell selected for the Popover's trigger button, marked by a dashed outline](https://bitfocus.io/api/docs-media/file/select-trigger-cell-1.png?prefix=docs-media)

2. Click and drag to also select the cells the unfolded Popover should occupy.

![The selection dragged from the trigger cell across the area the unfolded Popover will cover, showing the hint “Right click to create…”](https://bitfocus.io/api/docs-media/file/drag-to-size-popover-1.png?prefix=docs-media)

3. Right-click the selection, then choose **Create... → Popover**.

![The right-click menu open on the selection, with Popover highlighted under Create…](https://bitfocus.io/api/docs-media/file/create-popover-menu-1.png?prefix=docs-media)

Even though you selected multiple cells, only the trigger button occupies space until the Popover opens: the rest of the selected area stays free for other controls.

![The finished Popover on the canvas, occupying only its single trigger cell while the rest of the selected area stays empty. Its label bar shows Popover: Popover Section 1, its 4 × 3 size, and an open/close button](https://bitfocus.io/api/docs-media/file/popover-collapsed-1.png?prefix=docs-media)

## Customize its appearance

Select the Popover and use the **Design** tab to set the trigger button's own **Layout**, **Icon**, **Text**, and colors under **Button Styling**, plus the expanded section's own colors under **Section Styling**. When the inspector is narrow, its tabs show only their icons: the **Design** tab is the first one, with a brush icon.

![The Popover's Design tab, with Button Content (Layout, Icon, Text), Button Styling, Section Styling (Main Color, Secondary Color), and Location](https://bitfocus.io/api/docs-media/file/popover-design-tab.png?prefix=docs-media)

The **Popover** tab, the last tab, controls the Popover itself:

- **Dimensions**: the width and height of the unfolded section.
- **Snap to**: where the unfolded section anchors. **Button** (the default) anchors it to the trigger button itself, and unlocks the **Placement** and **Fit Surface** options below. **Absolute Position** anchors it to a fixed spot on the canvas instead: turn on **Position Offset** and its X/Y become the section's exact canvas coordinates, so it always opens in the same place no matter where the trigger button sits. Choosing one of the **Surface 1–8** options anchors it to a corner of that specific attached surface instead, and replaces **Placement** with a **Corner** picker (Top Left/Top Right/Bottom Left/Bottom Right).
- **Placement**: (Snap to: Button only) which direction the section unfolds from the trigger button, chosen from a compass of eight directions.
- **Fit Surface**: (Snap to: Button only, and only while **Position Offset** is off) whether the section is allowed to reposition itself to stay fully visible. **Auto Fit Position** flips the unfold direction away from **Placement** when the configured direction would run off the edge of the canvas. **Force Placement** always unfolds in the exact configured direction, even if that clips part of the section off the edge.
- **Position Offset**: move the unfolded section away from the trigger button to any position on the canvas, instead of unfolding right next to it. For **Snap to: Absolute Position**, this is the only way to set where the section appears.
- **Animation**: (Snap to: Button only) turn the open/close animation on or off.
- **Dismiss on click**: automatically close the Popover after a button inside it is pressed.
- **Momentary**: instead of toggling open and closed on separate presses, the trigger opens the section on press and closes it again as soon as it's released, like a hold-to-show control.

![The Popover tab with Dimensions set to 4 by 3, Snap to set to Button, Fit Surface set to Force Placement, Placement set to Right Bottom, and the Position Offset, Animation, Dismiss on click, and Momentary switches](https://bitfocus.io/api/docs-media/file/popover-inspector-1.png?prefix=docs-media)

A Popover can also scroll its own content: on the **Navigation** tab, turn **Scroll** on to let the section's contents scroll vertically when they don't fit, with a **Scrollbar** option to show it automatically, hide it, or pin it to the left or right edge.

## Open, close, and control the Popover

The trigger button opens and closes the Popover by default when pressed. You don't need to add an action for that.

![The Popover unfolded in the editor after selecting the open/close button in its label bar: the trigger now shows CLOSE and the expanded 4 by 3 section covers the cells it was sized for](https://bitfocus.io/api/docs-media/file/popover-open-1.png?prefix=docs-media)

### Run actions when the Popover opens or closes

The Popover's **Actions** tab (the lightning-bolt icon) starts with the usual **Press** and **Release** handlers. Under **Add Action Handler** you can also add two Popover-specific ones:

| Handler | Runs its actions |
| --- | --- |
| **Press** | When the trigger button goes down, as on any button. |
| **Release** | When the trigger button comes back up. |
| **Open** | Each time the Popover opens. |
| **Close** | Each time the Popover closes. |

![The Popover's Actions tab with empty Press and Release handlers, and Press, Release, Open, and Close under Add Action Handler](https://bitfocus.io/api/docs-media/file/popover-action-handlers.png?prefix=docs-media)

**Open** and **Close** are useful for setting something up while the Popover is in use and putting it back afterwards. For example, a Popover that holds camera shading controls can show the switcher's preview on the operator's monitor while it's open:

1. On the Popover's **Actions** tab, select **Open** and **Close** under **Add Action Handler**.
2. Under **Open**, add the ATEM **Aux/Output: Set source** action, with **Aux/Output** set to the monitor's aux (here **Aux 1**) and **Input** set to **Preview**.
3. Under **Close**, add the same action with **Input** set to **Program**.
4. Select **Apply**.

![The Popover's Actions tab with Press and Release collapsed, an ATEM Aux/Output: Set source action under Open that sets Aux 1 to Preview, and the same action under Close that sets Aux 1 to Program](https://bitfocus.io/api/docs-media/file/popover-open-close-actions.png?prefix=docs-media)

Opening the Popover on the surface now switches Aux 1 to Preview, and closing it switches Aux 1 back to Program. Other uses follow the same pattern: close another Popover with **Set Popover State** under **Open** so only one is open at a time, or reset a variable under **Close**.

<callout color="gray" title="Note">
  **Open** and **Close** only run when the Popover opens or closes on a surface. Holding **Shift** and clicking the trigger in the editor runs its **Press** and **Release** actions and opens or closes the Popover, but doesn't run **Open** or **Close**, so you can open and close the Popover while editing without changing anything on your devices. To try one of those actions on its own, use the lightning-bolt icon on that action's row.
</callout>

To control a Popover from a different button, use the internal action **Set Popover State**:

1. On the button that should control it, add the **Set Popover State** action.
2. Under **Popover**, select which Popover it targets.
3. Under **Command**, choose **Open**, **Closed**, or **Toggle**.

This lets one button open a Popover, a different button close it, or a single button toggle it: useful when the trigger you want people to use isn't the Popover's own button.

## If you get stuck

| What you see | What to try |
| --- | --- |
| The Popover won't stay open after you click elsewhere. | Check **Dismiss on click**: it closes the Popover as soon as a button inside it is pressed, which can look like it closed on its own. |
| The Popover overlaps other controls when it opens. | Adjust **Placement** or turn on **Position Offset** to move it away from crowded areas. |
| A different button's **Set Popover State** action doesn't seem to do anything. | Confirm **Popover** is set to the Popover you meant: a control left at its default can silently target nothing. |

## Where to go next

- [Organize controls in a section](/docs/buttons/v1.10/positions/basic-sections), for controls that should be visible all the time instead of tucked away.
