Popconfirm

Request a brief confirmation near the action 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>Archive item<sy-popconfirm
      position="bottom"
      confirmtext="Archive"
      canceltext="Cancel"
      arrow
      animation="none"
      id="sample"
    ><span>Archive this example item?</span></sy-popconfirm>
  </sy-button>
</div>

Usage guide

#

Use for actions requiring a brief confirmation, such as deletion or reset. Use Modal for longer explanations or input.

  1. Place inside the action button

    Put the question in the default slot and make outcomes clear with confirmText and cancelText.

  2. Distinguish confirmation results

    Check for ok or cancel in selected.detail.

  3. Act only after confirmation

    Perform the actual action only after receiving ok. Do not run it on the button's initial click.

Feature examples

#

Choose a feature from 16 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 · Cancel Text

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Closable

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 · Confirm Text

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.

Events · Selected

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Visible Changed

Interact with the component to see event names and payloads in the live preview below.

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-popconfirm>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseShow an arrow pointing to the trigger.
booleanfalseShow the close button.
'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom''top'Popup placement relative to the trigger.
'click' | 'none''click'User action that opens the list or popup.
number0Opening delay in milliseconds.
number0Closing delay in milliseconds.
string'OK'Confirmation button text.
string'Cancel'Cancel button text.
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.

Events

EventDetailDescription
CustomEvent<boolean>Read the result from the event's detail.
CustomEvent<'ok' | 'cancel'>Emitted when the user selects an item.

Methods

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

Slots

SlotDescription
Component body or child items.