0.1.0 • Published 3 years ago

@simplr-wc/dialog v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Simplr Dialog

Usage

Import
import SimplrDialog from "@simplr-wc/dialog";
Use
const dialog = new SimplrDialog({
    primaryAction: {label: "Cool"},
    secondaryAction: {label: "Bleh"},
    heading: "Hello",
    content: "Hello world :) This is my first dialog"
});

dialog.openDialog();

Properties

PropertyAttributeTypeDefaultDescription
contentcontentobjectContent of dialog
headingheadingstringHeading of the dialog element
onClosedonClosedFunctionCallback function launched as dialog is closed
onOpenedonOpenedFunctionCallback function launched as dialog is opened
openopenbooleanfalseIs the dialog open
primaryActionprimaryActionobjectButton label and action on dialog's primary button
secondaryActionsecondaryActionobjectButton label and action on dialog's secondary button
stackedstackedbooleanShould dialog actions be stacked

Methods

MethodType
openDialog(): void