<!-- AUTO-GENERATED from the @riverty/web-components custom elements manifest. Do not edit by hand. -->

# r-popover

A floating contextual overlay anchored to a trigger element, with headline, body content, and action slots. Supports auto or manual dismiss.

Example
```
<r-popover>
  <r-popover-trigger>
    <r-icon-button name="info" label="More information"></r-icon-button>
  </r-popover-trigger>
  <r-popover-headlineMore details</r-popover-headline>
  <r-popover-content>Here is some additional information about this topic.</r-popover-content>
  <r-popover-action>
    <r-button variant="primary">Got it</r-button>
  </r-popover-action>
</r-popover>
```

## class: `RPopover`, `r-popover`

### Fields

| Name               | Privacy | Type                                       | Default    | Description                                                                                                                                                                                                        | Inherited From |
| ------------------ | ------- | ------------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
| `dismissAriaLabel` |         | `string`                                   |            | Defines `aria-label` content for the dismiss button.<br>Used for accessibility when dismiss button is present.                                                                                                    |                |
| `dismissMode`      |         | `"auto" \| "manual"`                       | `'auto'`   | Defines the behavior of the popover's dismissing.<br>\- `auto`: The popover can be dismissed by clicking outside or pressing Esc.<br>\- `manual`: The popover requires explicit user action to close.            |                |
| `horizontal`       |         | `"center" \| "cover" \| "left" \| "right"` | `'center'` | Defines preferred placement horizontally relative to the trigger.<br>\- `left`: Align to the left of the trigger<br>\- `center`: Center align with the trigger<br>\- `right`: Align to the right of the trigger |                |
| `open`             |         | `boolean`                                  |            | Defines initial state of the popover visibility.                                                                                                                                                                   |                |
| `triggerAction`    |         | `"hide" \| "show" \| "toggle"`             | `'toggle'` | Defines the action that will be triggered when the trigger is clicked.<br>\- `toggle`: Toggle the popover open/closed state<br>\- `show`: Only show the popover<br>\- `hide`: Only hide the popover             |                |
| `triggerAriaLabel` |         | `string`                                   |            | Defines `aria-label` content for the popover trigger.<br>Used for accessibility to describe the trigger button.                                                                                                   |                |
| `vertical`         |         | `"bottom" \| "cover" \| "middle" \| "top"` | `'bottom'` | Defines preferred placement vertically relative to the trigger.<br>\- `top`: Position above the trigger<br>\- `bottom`: Position below the trigger<br>\- `middle`: Position to the side of the trigger          |                |

### Methods

| Name       | Privacy | Description                                                                                                                                                                                                                     | Parameters | Return          | Inherited From |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | --------------- | -------------- |
| `hide`     |         | Method to hide the popover.<br>Closes the popover and emits hide event.                                                                                                                                                        |            | `Promise<void>` |                |
| `setBlur`  |         | Remove focus from all focusable elements within the popover.<br>Calls setBlur on all child components and the host element.                                                                                                    |            | `Promise<this>` |                |
| `setFocus` |         | Set focus inside the popover to the most appropriate element.<br>Priority order:<br>1\. Dismiss button (if present)<br>2\. Action element (if present)<br>3\. Content element (if present)<br>4\. Host element as fallback |            | `Promise<this>` |                |
| `show`     |         | Method to show the popover.<br>Opens the popover, positions it correctly, and sets focus to appropriate element.                                                                                                               |            | `Promise<void>` |                |
| `toggle`   |         | Toggle popover visibility.<br>Shows the popover if hidden, hides it if shown.                                                                                                                                                  |            | `Promise<void>` |                |

### Events

| Name                | Type                              | Description                     | Inherited From |
| ------------------- | --------------------------------- | ------------------------------- | -------------- |
| `focusPopover`      | `CustomEvent<void>`               | Emits when popover focus is set |                |
| `hidePopover`       | `CustomEvent<void>`               | Emits when popover is hidden    |                |
| `popoverOpenChange` | `CustomEvent<{ open: boolean; }>` | Emits when open state changes   |                |
| `showPopover`       | `CustomEvent<void>`               | Emits when popover is shown     |                |

### Attributes

| Name                 | Field            | Inherited From |
| -------------------- | ---------------- | -------------- |
| `dismiss-aria-label` | dismissAriaLabel |                |
| `dismiss-mode`       | dismissMode      |                |
| `horizontal`         | horizontal       |                |
| `open`               | open             |                |
| `trigger-action`     | triggerAction    |                |
| `trigger-aria-label` | triggerAriaLabel |                |
| `vertical`           | vertical         |                |

### Slots

| Name       | Description                                                     |
| ---------- | --------------------------------------------------------------- |
| `action`   | Action buttons inside the popover (use `r-popover-action`)      |
| `content`  | Body content of the popover (use `r-popover-content`)           |
| `headline` | Headline content inside the popover (use `r-popover-headline`)  |
| `trigger`  | The element that triggers the popover (use `r-popover-trigger`) |

<hr/>

## Exports

| Kind                        | Name        | Declaration | Module | Package |
| --------------------------- | ----------- | ----------- | ------ | ------- |
| `js`                        | `RPopover`  | RPopover    |        |         |
| `custom-element-definition` | `r-popover` | RPopover    |        |         |
