Actions
Since 0.1.0-alpha.13
The members for actions, and the types they use. Every member of
IzzyBlazor.Toolbar is on the Toolbar API.
Parts (3)
Components written inside Toolbar, and the columns' members, which PropertyColumn and TemplateColumn share.
ToolbarButton
A Button in a Toolbar or a ToolbarButtonGroup. In the "…" menu it's a menu item with the same link, form post and OnClick; a toggle (Pressed) is a checkbox item there.
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).
@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.
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.
ToolbarIconButton
An IconButton in a Toolbar or a ToolbarButtonGroup. In the "…" menu it's a menu item with its icon, its Label as text, and the same link, form post and OnClick; a toggle (Pressed) is a checkbox item there.
Submitbool = falseSubmits the form it's in (or Form), when it's a button (not a link), like type="submit".
Namestring?Posted with the form as Name=Value when this button submits it, so one handler can tell which button was pressed, such as which row's Delete. 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).
@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.
OnClickEventCallback<MouseEventArgs>Runs on click on interactive pages (a link still navigates).
Plus 16 item props and 4 common props.
ToolbarSplitButton
A SplitButton in a Toolbar. In the "…" menu it's a submenu named by its MenuLabel, with the main action as its first item, then the same items; with MenuDisabled it's just the main action.
PositionToolbarPosition = ToolbarPosition.StartWhere it sits. Defaults to ToolbarPosition.Start.
Priorityint = 0Which items stay longest when there's no room: higher stays longer. Defaults to 0. Items with the same priority move into the menu from the middle of the toolbar outward.
OverflowToolbarOverflow = ToolbarOverflow.AutoWhen it moves into the "…" menu: ToolbarOverflow.Never for the main action, ToolbarOverflow.Always for what only the menu needs. Defaults to ToolbarOverflow.Auto.
Labelstring requiredThe main button's text, or with IconOnly its name for screen readers and its tooltip.
StartIconIconData?An icon before the main button's text.
Hrefstring?Makes the main button a link to this URL (an a). A link can't take Submit, Name, Value, FormAction or Form.
Externalbool = falseFor a link: opens in a new tab with rel="noopener noreferrer" and shows an external-link icon.
Namestring?Posted with the form as Name=Value when the main button submits it, so one handler can tell it from the menu's items. Not action, method or target: a control with one of those names hides the form's own property.
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 the main button submits (native form).
AccentAccent? (computed)The color of both parts. Defaults to a ButtonGroup's or Toolbar's around it, else Primary.
VariantButtonVariant? (computed)The weight of both parts. Defaults to a ButtonGroup's or Toolbar's around it, else ButtonVariant.Solid.
SizeControlSize? (computed)The height of both parts. Defaults to a ButtonGroup's or Toolbar's around it, else ControlSize.Md.
Disabledbool = falseDisables both parts.
Loadingbool = falseShows a spinner on the main button and blocks both parts, which keep focus.
LoadingLabelstring? = "Loading"Read to screen readers while Loading. Defaults to "Loading".
NewTabLabelstring? = "(opens in a new tab)"Read to screen readers after an external link's text. Defaults to "(opens in a new tab)".
FullWidthbool = falseStretches to the full width of its container; the main button takes the extra width.
MainDisabledbool = falseDisables only the main button, such as when no default is available but the items still are.
PlacementPlacement = Placement.BottomStartWhere the menu opens, against the whole button. Defaults to Placement.BottomStart.
PanelWidthLength? (computed)The width of the menu panel, as on Menu. Defaults to the content's width, at least 10rem, up to 24rem.
ChildContentRenderFragment?The MenuItems, MenuGroups and MenuDividers.
OnClickEventCallback<MouseEventArgs>Runs when the main button is clicked on interactive pages (a link still navigates). Has no effect on static pages.
Plus 16 item props and 4 common props.
Types (7)
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 |
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. |
Length
structA width, height or flex basis: a size token, a keyword, or a CSS length built with a factory such as Rem.
| Member | Description |
|---|---|
Sm | 640px (matches the |
Md | 768px (matches the |
Lg | 1024px (matches the |
Xl | 1280px (matches the |
Prose | A comfortable reading width, 68 characters. |
Full | 100% of the containing block. |
Auto |
|
FitContent |
|
MinContent |
|
MaxContent |
|
Px(double value) | Pixels. |
Rem(double value) | Root ems (16px each by default). |
Percent(double value) | Percent of the containing block. |
Ch(double value) | Character widths, for text measures. |
Vw(double value) | Percent of the viewport width. |
Dvh(double value) | Percent of the dynamic viewport height (accounts for mobile browser bars). |
Of(string css) | Any CSS length, such as |
Css string | The CSS value this length renders as. |
Placement
enumWhere a floating element sits next to the thing that opened it. Start and End follow the reading direction, so they flip in right-to-left languages.
| Value | Description |
|---|---|
BottomStart | Below, lined up with the start edge (the default for menus). |
Bottom | Below, centered. |
BottomEnd | Below, lined up with the end edge. |
TopStart | Above, lined up with the start edge. |
Top | Above, centered (the default for tooltips). |
TopEnd | Above, lined up with the end edge. |
Start | Beside, on the start side (the left in left-to-right languages). |
End | Beside, on the end side (the right in left-to-right languages). |
ToolbarOverflow
enumWhen an item of a Toolbar moves into its "…" menu.
| Value | Description |
|---|---|
Auto | When there's no room for it, in order of |
Never | Never: it stays in the bar, such as the main action. |
Always | Always: it's only in the menu, such as Print or Version history. |
ToolbarPosition
enumWhere an item of a Toolbar sits.
| Value | Description |
|---|---|
Start | At the start (the left in left-to-right text), the default. |
Center | In the middle, kept centered between the start and the end. |
End | At the end, before the "…" menu. |