Skip to content
W WRNexusJS
overlays component

PromptDialog

Reusable prompt dialog component.

@wrnexus/ui 0.2.675 props1 slots0 events

Usage

Components are auto-discovered. Use the component directly in any .wrn view:

<PromptDialog
  title="title"
  description="description"
  open="false"
  closeLabel="Close"
/>

Legacy mount name: data-component="PromptDialog".

Props and attributes

PropTypeRequirementDefault
titlestringOptional""
descriptionstringOptional""
openbooleanOptionalfalse
closeLabelstringOptional"Close"
classstringOptional""

Slots

  • default

Events

This component does not declare a custom event.

Source contract

Installed source: components/PromptDialog.wrn

component PromptDialog {
  props {
    title = ""
    description = ""
    open = false
    closeLabel = "Close"
    class = ""
  }
  view {
        <div data-show="open" class="wire-overlay wire-catalog-overlay {class}">
        <section role="dialog" aria-modal="true" aria-label="{title}" class="wire-dialog">
        <header>
        <h2 data-show="title" class="wire-dialog__title">{title}</h2>
        <p data-show="description" class="wire-dialog__description">{description}</p>
        </header>
        <slot />
        <button type="button" class="wire-btn wire-btn--ghost">{closeLabel}</button>
        </section>
        </div>
    }
}