bootstack.dialogs.DialogButton#

class bootstack.dialogs.DialogButton(text, role='secondary', result=None, 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').

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

Callback invoked when clicked. Returning False refuses the press — no result is recorded, and a dialog stays open — which is how a button rejects the input it was given. Any other return value, including None, accepts it. The same applies wherever these specifications are used, including the button row of a Form.

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: ButtonVariant | str | None = None#

Button style variant — 'default', 'solid', 'outline', or 'ghost'.