Skip to content

DialogButton

Specification for a dialog button.

Attributes:

Name Type Description
text str

Button label text displayed to the user.

role ButtonRole

Button role determining styling and behavior. - "primary": Main action (blue, triggered by Enter) - "secondary": Standard action (gray) - "danger": Destructive action (red) - "cancel": Cancel action (outline, triggered by Escape) - "help": Help/info action (link style)

result Any | None

Value assigned to dialog.result when clicked.

closes bool

Whether button closes the dialog when clicked.

default bool

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

command Callable[[Dialog], None] | None

Callback called when clicked.

accent str | None

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

variant str | None

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

icon str | dict | None

Optional icon specification for the button.