Popover

Display more information or a small content area near an element.

Live preview
Interact with the component to see results here.
View code
HTML
<div style="display:inline-flex;align-self:center;margin:70px 0">
  <sy-button>Detailed guidance<sy-popover
      trigger="click"
      arrow
      position="bottom"
      opendelay="0"
      closedelay="100"
      animation="none"
      id="sample"
    >
      <div style="padding:12px;max-width:220px"><strong>Share with your
          team</strong>
        <p>Team members invited to the project can view it together.</p>
      </div>
    </sy-popover>
  </sy-button>
</div>
<div class="demo-actions"
  style="display:flex;flex-wrap:wrap;gap:8px;margin-top:16px"
>
  <sy-button id="action-0" size="small">Display</sy-button>
  <sy-button id="action-1" size="small">Hide</sy-button>
</div>
<output id="demo-result" aria-live="polite"></output>

<script type="module">
  const describeResult = value => JSON.stringify(value, (_key, item) => {
    if (item instanceof File) return {
      name: item.name,
      size: item.size,
      type: item.type
    };
    if (item instanceof Element) return `<${item.localName}>`;
    return item;
  }) ?? 'Done';
  const actionTarget0 = document.querySelector("#sample");
  document.querySelector('#action-0').addEventListener('click', async () => {
    const result = await actionTarget0.setOpen();
    document.querySelector('#demo-result').textContent = describeResult(result);
  });
  const actionTarget1 = document.querySelector("#sample");
  document.querySelector('#action-1').addEventListener('click', async () => {
    const result = await actionTarget1.setClose();
    document.querySelector('#demo-result').textContent = describeResult(result);
  });
</script>

Usage guide

#

Provide additional information or a small interaction near its target. Use Tooltip for short descriptions and Popconfirm for confirmation questions.

Content and placement
Place it inside the trigger and put content in the default slot. Set placement and arrow visibility with position and arrow; the popup adjusts to available screen space.
Opening behavior
Choose click, hover, or focus to suit the workflow.
Direct control
Disable automatic triggers with trigger="null", then use setOpen(), setClose(), or open.

Feature examples

#

Choose a feature from 12 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Animation

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · AnimationSpeed

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Arrow

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Closedelay

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Open

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Opendelay

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Position

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Sticky

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Trigger

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Methods · Set Close

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Set Open

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-popover>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseShow an arrow pointing to the trigger.
booleanfalseWhether the submenu is expanded.
'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom''bottom'Popup placement relative to the trigger.
'hover' | 'click' | 'focus' | 'null''hover'User action that opens the list or popup.
number0Opening delay in milliseconds.
number100Closing delay in milliseconds.
booleanfalseStick to the top of the nearest scroll container.
| 'none' | 'fade' | 'fade-scale' | 'zoom' | 'pop' | 'slide-top' | 'slide-bottom' | 'slide-left' | 'slide-right' | 'slide-fade-top' | 'slide-fade-bottom' | 'slide-fade-left' | 'slide-fade-right' | 'reveal-top' | 'reveal-bottom' | 'reveal-left' | 'reveal-right' | 'flip-x' | 'flip-y' | 'bounce' | 'spin''none'Enter/exit animation type. `none` (default) toggles instantly.
'x-fast' | 'fast' | 'medium' | 'slow' | 'x-slow''fast'Animation playback speed token. Maps to `--transition-*` global tokens.

Methods

MethodReturnsDescription
Promise<void>Expand the submenu.
Promise<void>Close the item.

Slots

SlotDescription
Component body or child items.