# Popover

> A non-modal layer anchored to its trigger that flips and shifts to stay on screen.

- Tier: free, MIT
- Category: Overlays
- Docs: https://ui.mlola.com/docs/components/popover

## Install

```bash
npx mlola-ui add popover
```

```tsx
import { Popover } from "@/components/ui/popover";
```

## Props with fixed values

| Component | Prop | Values | Default | Description |
| --- | --- | --- | --- | --- |
| Popover | `align` | `start`, `center`, `end` | `start` |  |
| Popover | `side` | `top`, `bottom`, `left`, `right` | `bottom` |  |

## Example

```tsx
import { Button } from "@/components/ui/button";
import { Popover } from "@/components/ui/popover";

export default function Example() {
  return (
    <Popover label="Share" trigger={<Button variant="secondary">Share</Button>}>
      <p>Anyone with the link can view this page.</p>
    </Popover>
  );
}
```

## The same markup without React

```html
<button class="ml-button" type="button" data-variant="secondary" data-size="md" aria-haspopup="dialog" aria-expanded="false"><span class="ml-button-label">Share</span></button>
```
