PyBlade/ui
Menu⌄
DocsComponentsDialog

Dialog

A modal window, opened by its trigger or by name.

Alpine.jsdepends on button6 files

Installation

pyblade-ui add dialog

Usage

The tags <pb-ui.dialog> <pb-ui.dialog-header> <pb-ui.dialog-title> <pb-ui.dialog-description> <pb-ui.dialog-footer> <pb-ui.dialog-close> are available in all your templates.

<pb-ui.dialog name="delete">
  <pb-slot:trigger><pb-ui.button variant="destructive">Delete</pb-ui.button></pb-slot:trigger>
  <pb-ui.dialog-header>
    <pb-ui.dialog-title>Are you sure?</pb-ui.dialog-title>
    <pb-ui.dialog-description>This cannot be undone.</pb-ui.dialog-description>
  </pb-ui.dialog-header>
  <pb-ui.dialog-footer>
    <pb-ui.dialog-close><pb-ui.button variant="outline">Cancel</pb-ui.button></pb-ui.dialog-close>
  </pb-ui.dialog-footer>
</pb-ui.dialog>
{# Or from anywhere: $dispatch('dialog-open', 'delete') #}

Examples

Opened by name

Props

PropDefault
name''
trigger''
openFalse

Any other attribute (class, id, x-on:click, hx-post…) is passed to the root element; your Tailwind classes win over the component's.