# Popover

A floating panel anchored to its trigger, on the native popover attribute.

## Anchoring

The panel opens below the trigger and flips above when out of room. Light dismiss and Esc come from `popover="auto"`; the panel lives in the top layer, so it never fights z-index.

`align="start"` lines the panel up with the trigger's left edge; `align="end"` tracks its right edge with the panel's.

## Examples

```svelte
<script lang="ts">
  import Popover from '@qualia-studios/design-ui/components/Popover.svelte';
</script>
```

### Example 1: Aligned to the start

```svelte
<Popover class="demo-trigger" align="start">
  {#snippet trigger()}
    Options ▾
  {/snippet}
  <div class="demo-panel">
    <p>Anchored below the trigger, flipped above when out of room.</p>
  </div>
</Popover>
```

### Example 2: Aligned to the end

```svelte
<Popover class="demo-trigger" align="end">
  {#snippet trigger()}
    Aligned to end ▾
  {/snippet}
  <div class="demo-panel">
    <p>The panel's right edge tracks the trigger's right edge.</p>
  </div>
</Popover>
```

---

From the Qualia design guide: https://q-core-3b2732.gitlab.io/components/popover. Every page as markdown: https://q-core-3b2732.gitlab.io/llms.txt
