Skip to content
IzzyBlazor 0.1.0-alpha.17

Enter all results ↑ ↓ move Esc close

Dialog

A native modal dialog, opened by a trigger, a link or C#.

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

Properties (12)

Titlestring?

The heading, which also names the dialog for screen readers.

CloseLabelstring? = "Close"

The close button's name. Defaults to "Close".

ChildContentRenderFragment?

The body, plus any DialogHeader and DialogFooter.

ContentPaddingResponsive<int>Responsive

Padding inside the body, in spacing steps, in place of the dialog's. 0 lets content such as a table or image run edge to edge.

SizeDialogSize = DialogSize.Md

The width. Defaults to DialogSize.Md.

PlacementDialogPlacement = DialogPlacement.Center

Center (the default), a full-height drawer on the start or end side, or a full-width sheet along the top or bottom. A Drawer defaults to DialogPlacement.End.

CloseOnBackdropbool = true

Closes when the backdrop is clicked. Defaults to true. Escape always closes it.

ShowCloseButtonbool = true

Shows the close button in the header. Defaults to true.

InsideFormbool = false

Set when the dialog is inside a <form>. Forms can't nest, so the dialog then closes with the native close command (with a script fallback in older browsers) instead of its own method="dialog" form, and its buttons don't submit the outer form.

QueryKeystring? = "dialog"

The query-string key that opens a dialog from a link: ?dialog=my-id renders the dialog with that id already open. Defaults to dialog; null turns it off.

@bind-Openbool = false @bind: Interactive only

Whether it is open. Use @bind-Open to follow changes on interactive pages.

Idstring?

The element id. Generated when not set.

Item props (from LayoutItemBase)

MarginResponsive<int>Responsive

Margin on all sides, in spacing steps (-16 to 16; one step = 4px).

MarginXResponsive<int>Responsive

Horizontal margin. When set, replaces Margin on this axis.

MarginYResponsive<int>Responsive

Vertical margin. When set, replaces Margin on this axis.

MarginTopResponsive<int>Responsive

Top margin. When set, replaces MarginY and Margin on this side.

MarginBottomResponsive<int>Responsive

Bottom margin. When set, replaces MarginY and Margin on this side.

MarginStartResponsive<int>Responsive

Margin at the start (left in left-to-right text, right in right-to-left). Replaces MarginX and Margin on this side.

MarginEndResponsive<int>Responsive

Margin at the end (right in left-to-right text, left in right-to-left). Replaces MarginX and Margin on this side.

WidthResponsive<Length>Responsive

Width.

MinWidthResponsive<Length>Responsive

Minimum width.

MaxWidthResponsive<Length>Responsive

Maximum width.

Growbool = false

Whether to grow into free space inside a Stack, Row or Column: <Box Grow>.

Shrinkbool = true

Whether to shrink when space is short inside a Stack, Row or Column. Defaults to true; Shrink="false" keeps the size.

BasisResponsive<Length>Responsive

Starting size inside a Stack, before growing or shrinking.

AlignSelfResponsive<Align>Responsive

Alignment across the parent's direction, overriding the parent's Align for this component only, such as a button lined up with the bottom of labeled fields in a Row.

ColSpanResponsive<int>Responsive

How many columns it spans in a Form or Fieldset with Columns, or a Grid; GridSpan.Full for the whole row. Never more than the columns shown, so a form that narrows to one column needs no breakpoints.

NewRowbool = false

Starts a new row in a Form or Fieldset with Columns, or a Grid, leaving the rest of the row before it empty.

Common props (from IzzyComponentBase)

Classstring?

Extra CSS classes, merged after the component's own classes.

Stylestring?

Inline style, appended after the component's generated custom properties.

HiddenFromBreakpoint?

Hides the component from this breakpoint up, such as a menu button only phones need.

VisibleFromBreakpoint?

Shows the component only from this breakpoint up, such as header links for wide screens.

Events (0)

No events.

Parts (6)

Components written inside Dialog, documented here with it.

DialogTrigger

A Button that opens a Dialog by id. It uses the native commandfor and command="show-modal" attributes, so it needs no C# and, in current browsers, no script; IzzyBlazor's script fills in for older ones.

Forstring required

The id of the dialog to open.

Hrefstring?From Button

Makes it a link to this URL (an a) instead of a button. A link can't take Submit, Reset, Name, Value, FormAction or Form.

Externalbool = falseFrom Button

For a link: opens in a new tab with rel="noopener noreferrer" and shows an external-link icon.

HideExternalIconbool = falseFrom Button

Leaves out an external link's icon, for repeated links where it would be noise. Screen readers still hear NewTabLabel.

NewTabLabelstring? = "(opens in a new tab)"From Button

Read to screen readers after an external link's text. Defaults to "(opens in a new tab)".

Submitbool = falseFrom Button

Submits the form it's in (or Form), like type="submit". Without Submit or Reset, a button does nothing by itself.

Resetbool = falseFrom Button

Resets the form it's in, like type="reset". Can't be combined with Submit.

Namestring?From Button

Posted with the form as Name=Value when this button submits it, so one handler can tell which of several submit buttons was pressed. 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?From Button

The value posted with Name.

FormActionstring?From Button

Submits to this URL instead of the form's own action (native formaction).

Formstring?From Button

The id of a form elsewhere on the page that this button submits (native form).

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.

OnClickEventCallback<MouseEventArgs>From ButtonInteractive only

Runs on click on interactive pages (a link still navigates). Has no effect on static pages.

DialogHeader

Heading content for a Dialog in place of its Title, such as a title with an icon or a badge. It names the dialog for screen readers. Write it directly in the dialog; the dialog draws it in its header row, beside the close button, so a form or cascading value it's written inside doesn't reach it.

ChildContentRenderFragment?

The part's content.

DialogBody

A Dialog's body with layout props: a column with Gap, Align, Justify and Direction, like Stack. Optional: content written straight in the dialog is its body too. It fills the dialog's height, so a DialogFooter after it sits at the bottom of a side drawer whatever the content's length; put it and the footer in a form to keep the footer's buttons in the form. With a DialogBody, put all the body's content in it: text written beside it is laid out as separate rows. Flush runs it to the dialog's edges, for a table or a list.

DirectionResponsive<Direction> (computed)Responsive

Layout direction. Defaults to a column.

Flushbool = false

Runs the content to the dialog's sides, without its side padding: for a table, a divided list or an image.

GapResponsive<int>Responsive

Space between children, in spacing steps (0 to 16).

AlignResponsive<Align> (computed)Responsive

Cross-axis alignment. Defaults to stretch.

JustifyResponsive<Justify> (computed)Responsive

Main-axis distribution. Defaults to start.

Wrapbool = false

Whether children wrap onto new lines: <Row Wrap>.

Inlinebool = false

Renders as inline-flex so the container sits in a line of text.

Asstring = "div"From Box

The element to render: div on a Box; components built on it set their own (List a ul, Section a section).

ChildContentRenderFragment?From Box

The content.

DialogFooter

The row of buttons at the bottom of a Dialog or Drawer, usually a DialogClose and the main action. Write it last: last in the dialog, or last in a form that's last in the dialog, so its buttons stay inside the form and submit it. It reaches the dialog's edges (and follows ContentPadding) and stays in view when the body scrolls. In a side drawer it follows the content, so with little content it sits partway down. A row like Row, with Gap, Align and Justify (the buttons go at the end by default). Also for content shown by DialogService.

GapResponsive<int>Responsive

Space between children, in spacing steps (0 to 16).

AlignResponsive<Align> (computed)Responsive

Cross-axis alignment. Defaults to stretch.

JustifyResponsive<Justify> (computed)Responsive

Main-axis distribution. Defaults to start.

Wrapbool = false

Whether children wrap onto new lines: <Row Wrap>.

Inlinebool = false

Renders as inline-flex so the container sits in a line of text.

Asstring = "div"From Box

The element to render: div on a Box; components built on it set their own (List a ul, Section a section).

ChildContentRenderFragment?From Box

The content.

DialogClose

A Button that closes the Dialog it is in. It submits the dialog's method="dialog" form, which closes it natively in every browser, script or not. In a dialog inside another form, it uses the native close command instead. Defaults to a neutral outline button, for "Cancel".

Forstring? (computed)

The id of the dialog to close. Defaults to the dialog this button is in.

Hrefstring?From Button

Makes it a link to this URL (an a) instead of a button. A link can't take Submit, Reset, Name, Value, FormAction or Form.

Externalbool = falseFrom Button

For a link: opens in a new tab with rel="noopener noreferrer" and shows an external-link icon.

HideExternalIconbool = falseFrom Button

Leaves out an external link's icon, for repeated links where it would be noise. Screen readers still hear NewTabLabel.

NewTabLabelstring? = "(opens in a new tab)"From Button

Read to screen readers after an external link's text. Defaults to "(opens in a new tab)".

Submitbool = trueFrom Button

Submits the form it's in (or Form), like type="submit". Without Submit or Reset, a button does nothing by itself.

Resetbool = falseFrom Button

Resets the form it's in, like type="reset". Can't be combined with Submit.

Namestring?From Button

Posted with the form as Name=Value when this button submits it, so one handler can tell which of several submit buttons was pressed. 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?From Button

The value posted with Name.

FormActionstring?From Button

Submits to this URL instead of the form's own action (native formaction).

Formstring?From Button

The id of a form elsewhere on the page that this button submits (native form).

AccentAccent = Accent.Neutral

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.Outline

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.

OnClickEventCallback<MouseEventArgs>From ButtonInteractive only

Runs on click on interactive pages (a link still navigates). Has no effect on static pages.

DialogHost

Where DialogService shows its dialogs. Put one on an interactive page or in an interactive layout, with @rendermode on the host where the layout is static:

No parameters of its own.

Types (8)

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.

Align

enum

Cross-axis alignment of a Stack's children.

Align values
ValueDescription
Stretch

Children stretch to fill the cross axis.

Start

Aligned to the start.

Center

Centered.

End

Aligned to the end.

Baseline

Aligned on their text baselines.

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.

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.

DialogPlacement

enum

Where a Dialog appears.

DialogPlacement values
ValueDescription
Center

In the middle of the screen (the default).

Start

A full-height drawer on the start side.

End

A full-height drawer on the end side.

Top

A full-width sheet along the top edge, as tall as its content.

Bottom

A full-width sheet along the bottom edge, as tall as its content. Suits phones.

DialogSize

enum

The width of a Dialog. A Drawer, or a dialog at the start or end edge, is narrower: Sm 20rem, Md 24rem, Lg 32rem, Xl 40rem.

DialogSize values
ValueDescription
Sm

24rem. Confirmations.

Md

32rem (the default).

Lg

48rem. Forms with two columns.

Xl

64rem. Tables and previews.

Full

The whole viewport.

Direction

enum

The direction a Stack lays out its children.

Direction values
ValueDescription
Row

Left to right (in left-to-right languages).

Column

Top to bottom.

RowReverse

Right to left.

ColumnReverse

Bottom to top.

Justify

enum

Main-axis distribution of a Stack's children.

Justify values
ValueDescription
Start

Packed at the start.

Center

Packed in the center.

End

Packed at the end.

Between

First and last at the edges, equal space between.

Around

Equal space around each child.

Evenly

Equal space between and at the edges.