Dialog
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.
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.MdThe width. Defaults to DialogSize.Md.
PlacementDialogPlacement = DialogPlacement.CenterCenter (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 = trueCloses when the backdrop is clicked. Defaults to true. Escape always closes it.
ShowCloseButtonbool = trueShows the close button in the header. Defaults to true.
InsideFormbool = falseSet 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 = falseWhether it is open. Use @bind-Open to follow changes on interactive pages.
Idstring?The element id. Generated when not set.
Plus 16 item props and 4 common props.
Show them hereEvents (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 requiredThe id of the dialog to open.
Hrefstring?Externalbool = falseFor a link: opens in a new tab with rel="noopener noreferrer" and shows an external-link icon.
HideExternalIconbool = falseLeaves 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)"Read to screen readers after an external link's text. Defaults to "(opens in a new tab)".
Submitbool = falseNamestring?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.
FormActionstring?Submits to this URL instead of the form's own action (native formaction).
Formstring?The id of a form elsewhere on the page that this button submits (native form).
AccentAccent = Accent.PrimaryPrimary (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.SolidVisual weight. Defaults to ButtonVariant.Solid.
SizeControlSize = ControlSize.MdHeight. Defaults to ControlSize.Md.
StartIconIconData?An icon before the text.
EndIconIconData?An icon after the text.
FullWidthbool = falseStretches to the full width of its container.
Loadingbool = falseShows a spinner in place of the start icon and blocks further clicks.
LoadingLabelstring? = "Loading"Read to screen readers while Loading. Defaults to "Loading".
Disabledbool = falseDisables the button.
@bind-Pressedbool?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>Runs on click on interactive pages (a link still navigates). Has no effect on static pages.
Plus 16 item props and 4 common props.
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.
Layout direction. Defaults to a column.
Flushbool = falseRuns the content to the dialog's sides, without its side padding: for a table, a divided list or an image.
Space between children, in spacing steps (0 to 16).
Cross-axis alignment. Defaults to stretch.
Main-axis distribution. Defaults to start.
Wrapbool = falseWhether children wrap onto new lines: <Row Wrap>.
Inlinebool = falseRenders as inline-flex so the container sits in a line of text.
Asstring = "div"The element to render: div on a Box; components built on it set their own (List a ul, Section a section).
ChildContentRenderFragment?The content.
Plus 25 surface props, 16 item props and 4 common props.
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?Externalbool = falseFor a link: opens in a new tab with rel="noopener noreferrer" and shows an external-link icon.
HideExternalIconbool = falseLeaves 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)"Read to screen readers after an external link's text. Defaults to "(opens in a new tab)".
Submitbool = trueNamestring?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.
FormActionstring?Submits to this URL instead of the form's own action (native formaction).
Formstring?The id of a form elsewhere on the page that this button submits (native form).
AccentAccent = Accent.NeutralPrimary (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.OutlineVisual weight. Defaults to ButtonVariant.Solid.
SizeControlSize = ControlSize.MdHeight. Defaults to ControlSize.Md.
StartIconIconData?An icon before the text.
EndIconIconData?An icon after the text.
FullWidthbool = falseStretches to the full width of its container.
Loadingbool = falseShows a spinner in place of the start icon and blocks further clicks.
LoadingLabelstring? = "Loading"Read to screen readers while Loading. Defaults to "Loading".
Disabledbool = falseDisables the button.
@bind-Pressedbool?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>Runs on click on interactive pages (a link still navigates). Has no effect on static pages.
Plus 16 item props and 4 common props.
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
classThe 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.
| Member | Description |
|---|---|
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 |
Token(string name) | A theme token, such as |
From(Color color) | A |
Align
enumCross-axis alignment of a Stack's children.
| Value | Description |
|---|---|
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
enumA button's visual weight, from strongest to quietest.
| Value | Description |
|---|---|
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
enumThe 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.
| Value | Description |
|---|---|
Sm | 32px tall, small text. |
Md | 36px tall (the default). |
Lg | 44px tall, large text. For touch-first and marketing pages. |
DialogPlacement
enumWhere a Dialog appears.
| Value | Description |
|---|---|
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
enumThe 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.
| Value | Description |
|---|---|
Sm | 24rem. Confirmations. |
Md | 32rem (the default). |
Lg | 48rem. Forms with two columns. |
Xl | 64rem. Tables and previews. |
Full | The whole viewport. |
Direction
enumThe direction a Stack lays out its children.
| Value | Description |
|---|---|
Row | Left to right (in left-to-right languages). |
Column | Top to bottom. |
RowReverse | Right to left. |
ColumnReverse | Bottom to top. |
Justify
enumMain-axis distribution of a Stack's children.
| Value | Description |
|---|---|
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. |