Skip to content

KPopconfirm

The floating card popped by clicking or hovering.

Install

bash
pnpm add @ikun-ui/popconfirm
bash
yarn add @ikun-ui/popconfirm
bash
npm install @ikun-ui/popconfirm

Basic usage

The most basic example. The size of the floating layer depends on the contents region.

Different emotion categories

Display different emotion category messages by type attribute.

Different placement

Specify different display positions through the placement attribute

Icon

Change the icon through the icon attribute

Different triggers

Specify different trigger methods through the trigger attribute

Make simple style modifications to the footer button

Async Close

Sometimes you don't want to close popconfirm immediately, but want to decide when to close it yourself

Popconfirm Props

NameTypeDefaultDescription
iconstring-The class name of the icon, following the unocss standard.
iconClsstring-Title icon class
disabledbooleanfalseWhether the Radio is disabled
type'success' | 'error' | 'warning' | 'info'infoThe emotion category of the popconfirm.
cancelBtnTextstringCancelcancel button text
confirmBtnTextstringConfirmconfirm button text
cancelBtnClsstring-cancel button class
confirmBtnClsstring-confirm button class
showCancelbooleantrueWhether to display a cancel button.
titlestring''Popconfrim title.
contentstring''Popconfrim content.
placement'top' | 'left' | 'right' | 'bottom'topWhere the popover appears
trigger'manual' | 'click' | 'hover'hoverHow popovers are triggered
asyncClosebooleanfalseWhen its value is true, clicking the button will not close popconfirm, and the user needs to control it himself.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Popconfirm Events

NameDescriptionType
confirmThe method when clicking the confirmation will return a close function, which is used to close popconfirm when asyncClose is true.(event: CustomEvent)=> void
cancelThe method when clicking the confirmation will return a close function, which is used to close popconfirm when asyncClose is true.(event: CustomEvent)=> void
changeTriggered when popconfirm displays a status change.(event: CustomEvent)=> void

Popconfirm Slots

NameDescription
defaultCustomize trigger content
titleCustomize popover's title content
contentCustomize popover content
footerCustomize popover's footer content

Popconfirm Api

NameDescriptionType
closeUsed to close popconfirm when using slot rendering.()=> void

MIT Licensed