0.1.4 • Published 2 years ago

@dpa-id-components/ui-dialog v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@dpa-id-components/ui-dialog

UiDialog Vue 2.x dialog component based on the dpa Design Kit

Installation

yarn add @dpa-id-components/ui-dialog

Usage

<!-- SomeComponent.vue using UiDialog -->
<template>
    <button @click="dialogIsVisible = true">Show Dialog</button>
    <ui-dialog
            v-if="dialogIsVisible"
            @close="handleEvent('close')"
    >
        <template #header>
            Header Slot content
        </template>
        Default Slot content
        <template #footer>
            Footer Slot content
        </template>
    </ui-dialog>
</template>

<script>
    import UiDialog from "@dpa-id-components/ui-dialog";

    export default {
        components: {
            UiDialog,
        },
        data() {
            return {
                dialogIsVisible: false
            };
        },
        methods: {
            handleEvent: console.log,
        },
    };
</script>

Demo

View a demo of <ui-dialog> on Storybook

API

Props

NameTypeDefaultDescription
scrollableBooleanfalseToggle if dialog content should be scrollable or not.
maxHeightStringnullOptional maximum height for the dialog.
roundedBorderBooleanfalseToggle if dialog should have a rounded border or not.

Slots

NameDescription
headerOptional slot for the header part of the dialog.
footerOptional slot for the footer part of the dialog.

Events

NameTypeDescription
closeEmitted when the background is closed.
0.1.2

2 years ago

0.1.1

2 years ago

0.1.4

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

3 years ago