Skip to content
IzzyBlazor 0.1.0-alpha.17

Enter all results ↑ ↓ move Esc close

ConfirmButton

Asks in an alert dialog before acting.

IzzyBlazor.ConfirmButton in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.17 assembly and its doc comments.

Properties (22)

Titlestring required

The question, such as "Delete this project?". Also the dialog's accessible name.

Messagestring?

A line under the question, such as "This can't be undone."

BodyRenderFragment?

More content under the question, such as a list of what will be deleted.

ConfirmTextstring? = "Confirm"

The confirm button's text, such as "Delete". Defaults to "Confirm".

CancelTextstring? = "Cancel"

The cancel button's text. Defaults to "Cancel".

Namestring?

Posted as Name=Value with the form when confirmed, so one handler can tell which action it was. Not action, method or target: a control with one of those names hides the form's own property, and Blazor's enhanced form handling then posts to the wrong address.

Valuestring?

The value posted with Name.

Formstring? (computed)

The id of a form elsewhere on the page to submit when confirmed. Defaults to the form the button is in.

FormActionstring?

Submits to this URL instead of the form's own action.

Hrefstring?

A link to follow when confirmed, in place of submitting a form.

Idstring?

The trigger's id. The dialog's is this plus -dialog.

AccentAccent = Accent.Primary

Primary (the default) for the main action, Neutral for everything else, Danger for destructive actions, or a custom color (Accent.Of("#0d9488"), Accent.Token("brand")); text on a custom color is chosen for contrast. Emphasis comes from Variant.

VariantButtonVariant = ButtonVariant.Solid

Visual weight. Defaults to ButtonVariant.Solid.

SizeControlSize = ControlSize.Md

Height. Defaults to ControlSize.Md.

StartIconIconData?

An icon before the text.

EndIconIconData?

An icon after the text.

FullWidthbool = false

Stretches to the full width of its container.

Loadingbool = false

Shows a spinner in place of the start icon and blocks further clicks.

LoadingLabelstring? = "Loading"

Read to screen readers while Loading. Defaults to "Loading".

Disabledbool = false

Disables the button.

@bind-Pressedbool?Added in 0.1.0-alpha.14 @bind: Interactive only

Makes it a toggle button, such as Bold in an editor: true shows it pressed, false not, and screen readers hear which (aria-pressed). With @bind-Pressed a click turns it on and off on interactive pages; on static pages the server decides, as with a submit button's Name and Value. Null (the default) is an ordinary button. Not for links.

ChildContentRenderFragment?

The label.

Events (1)

OnConfirmEventCallbackInteractive only

Runs when confirmed, on an interactive page. On a static page the confirm button submits the form instead.

Parts (1)

Components written inside ConfirmButton, documented here with it.

ConfirmDialogContent

DialogService.ConfirmAsync's content: the message, and Cancel (focused first) and confirm buttons.

Messagestring?

The question.

OptionsConfirmOptions

The buttons' text and color.

Types (4)

Accent

class

The color of a control: buttons, badges, tags, banners, progress bars and menu items. Primary, Neutral and Danger are the roles; emphasis comes from the variant (solid, soft, outline, ghost, link), not from more colors. For one control in another color, use Of (any CSS color) or Token (a theme token); text on it is chosen for contrast.

Accent members
MemberDescription
Primary

The brand color, for the main action.

Neutral

A quiet, gray action.

Danger

A destructive action, such as Delete.

Of(string css)

Any CSS color, such as "#0d9488". Text on it is black or white, whichever reads better.

Token(string name)

A theme token, such as "brand" for --ib-color-brand; text on it uses --ib-color-on-brand when the theme defines it.

From(Color color)

A Color as an accent, such as Color.Success.

ButtonVariant

enum

A button's visual weight, from strongest to quietest.

ButtonVariant values
ValueDescription
Solid

Filled with the accent color. For the main action.

Soft

A light tint of the accent color.

Outline

An accent-colored border on a transparent background.

Ghost

Transparent until hovered. For toolbars and dense layouts.

Link

Looks like a link.

ConfirmOptions

class

How ConfirmAsync asks.

ConfirmOptions members
MemberDescription
ConfirmText string?

The confirm button's text. Defaults to Ok ("OK").

CancelText string?

The cancel button's text. Defaults to Cancel.

Accent Accent = Accent.Primary

The confirm button's color, such as Danger for a delete. Defaults to primary.

ControlSize

enum

The height of interactive controls. Shared by buttons and form fields, so a button and an input of the same size line up in a row.

ControlSize values
ValueDescription
Sm

32px tall, small text.

Md

36px tall (the default).

Lg

44px tall, large text. For touch-first and marketing pages.