bootstack.dialogs.DialogButton#

class bootstack.dialogs.DialogButton(text, role='secondary', result=None, closes=True, default=False, command=None, accent=None, variant=None, icon=None)#

Bases: object

Specification for a dialog button.

accent: AccentToken | str | None = None#

Accent token for styling (e.g. 'primary', 'danger').

closes: bool = True#

Whether the button closes the dialog when clicked.

command: Callable[[Dialog], None] | None = None#

Callback invoked when clicked.

default: bool = False#

Whether this is the default button (focused, triggered by Enter).

icon: str | dict[str, Any] | None = None#

Optional icon specification for the button.

result: Any | None = None#

Value assigned to dialog.result when clicked.

role: ButtonRole = 'secondary'#

Role that determines the button’s styling and keyboard behavior. One of 'primary' (main action, triggered by Enter when default=True), 'secondary' (neutral action, no keyboard shortcut), 'danger' (destructive action, not focused by default), or 'cancel' (triggered by Escape).

text: str#

Button label text displayed to the user.

variant: VariantToken | str | None = None#

Style variant (e.g. 'outline', 'link').