Appearance
Popup
The HcPopup component inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks. Use popup sparingly because they are interruptive.
Basic Usage
Use modelValue prop to control visibility of Popup.
<template>
<ClientOnly>
<HcButton @click="visible = true">
Click to open
</HcButton>
<HcPopup
v-model="visible"
title="Basic popup"
custom-class="w-[400px]"
>
<template #body>
<div class="p-6 pb-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</div>
</template>
<template #footer>
<div class="grid grid-cols-2 gap-6 p-6">
<HcButton
type="outlined"
@click="visible = false"
>
Cancel
</HcButton>
<HcButton
@click="visible = false"
>
Confirm
</HcButton>
</div>
</template>
</HcPopup>
</ClientOnly>
</template>
<script lang="ts" setup>
import { HcPopup } from '@deeepvision/hope-component-kit';
import { ref } from 'vue';
const visible = ref(false);
</script>
Props
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| modelValue | String | String | binding value, whether popup is visible | false |
| title | String | String | popup title | |
| customClass | String | String | popup class | |
| overlayClass | String | String | custom class of popup overlay | |
| deletable | Boolean | Boolean | whether show delete icon | false |
| closable | Boolean | Boolean | whether show close icon | false |
| hideInnerScroll | Boolean | Boolean | whether hide inner scroll in popup body | false |
Slots
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| title | - | Customize title of the popup | ||
| body | - | Customize body of the popup | ||
| footer | - | Customize footer of the popup |
Events
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| update:model-value | Function | value - boolean | triggers when the binding value changes | |
| delete | Function | - | triggers when the delete icon is clicked in a deletable Popup | |
| close | Function | - | triggers when the close icon is clicked in a closable Popup |