A dedicated button that opens a global modal. Use it
when you want an explicit call-to-action rather than the hover "expand" icon
that modal_id= adds to other visuals.
Class:
dl2_reports.ModalButton· Legacy helper:row.add_modal_button(...)· Example: 15_links_and_modals.py
from dl2_reports import ModalButton
modal = report.add_modal("revenue-details", "Revenue Breakdown")
modal.add_row().add_table("regionalRevenue", title="Regional Data")
page.add_row(
ModalButton("revenue-details", "View Detailed Breakdown"),
)| Parameter | Type | Description |
|---|---|---|
modal_id |
str |
Required. Id of the global modal to open (serializes as the visual's id). |
button_label |
str |
Button text. |
extra |
dict |
Passthrough props. |
**common |
Common visual properties. |
| Trigger | How |
|---|---|
| Hover expand icon | modal_id="..." on any visual/layout (common prop). |
| Dedicated button | ModalButton("...", "Label") — this visual. |
| Table row double-click (dl2 0.4+) | row_modal_id="..." on a table/checklist. |
See Modals for defining modal content.