A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
❯buridan add dialogUse the following to build the Dialog component.
from components.ui.dialog import dialogFor manual installation, copy each of the source codes below in their respective locations.
Replace the default close control with your own button. Apply dialog.class_names.CLOSE_ICON to it for correct top-right positioning.
Props used: class_name on the button passed to dialog.close.
To omit the top-right close icon, simply don't render a dialog.close(...) for it — every other close mechanism (Escape, backdrop click, a footer button) still works.
Props used: none required — omit the icon dialog.close(...) call.
Keep actions visible while the content scrolls, using dialog.footer.
Props used: none required beyond standard dialog.footer composition.
Non-visual scoping wrapper (display: contents, adds no layout box). Trigger and close resolve their target <dialog> by walking up to the nearest dialog.root — no manual id threading, and multiple independent dialogs on the same page (e.g. a per-row "Share" dialog) never cross-target each other.
dialog.root(
dialog.trigger(button("Share", variant="outline")),
dialog.popup(...),
)
Wraps its child (typically a button(...)) with a capturing click listener that calls .showModal() on the nearest dialog.popup. No visual box of its own, so nesting a styled button inside doesn't add extra layout depth.
dialog.trigger(button("Share", variant="outline"))
Renders the native <dialog>. Escape and backdrop clicks both close it when dismissible=True (the default).
dialog.popup(
dialog.header(dialog.title("Share link")),
...,
)
When dismissible=False, both Escape and backdrop-click are disabled — only an explicit dialog.close(...) can close it.
Same behavioral wrapper as dialog.trigger, but calls .close(). Has no default visual styling of its own — apply dialog.class_names.CLOSE / dialog.class_names.CLOSE_ICON to whatever you pass in.
dialog.close(button("Close", type="button"))
dialog.close(
button(
hi("Cancel01Icon", class_name="size-4"),
variant="ghost",
size="icon-sm",
class_name=dialog.class_names.CLOSE_ICON,
)
)
dialog.title("Share link")
dialog.description("Anyone who has this link will be able to view this.")
dialog.header(
dialog.title("Share link"),
dialog.description("..."),
)
dialog.footer(dialog.close(button("Close", type="button")))