bootstack.dialogs.DialogButton#
- class bootstack.dialogs.DialogButton(text, role='secondary', result=None, default=False, command=None, accent=None, variant=None, icon=None)#
Bases:
objectSpecification 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
Falserefuses 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, includingNone, accepts it. The same applies wherever these specifications are used, including the button row of aForm.
- role: ButtonRole = 'secondary'#
Role that determines the button’s styling and keyboard behavior. One of
'primary'(main action, triggered by Enter whendefault=True),'secondary'(neutral action, no keyboard shortcut),'danger'(destructive action, not focused by default), or'cancel'(triggered by Escape).
- variant: ButtonVariant | str | None = None#
Button style variant —
'default','solid','outline', or'ghost'.