Toolbar
Since 0.1.0-alpha.13IzzyBlazor.Toolbar in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.17 assembly
and its doc comments.
Properties (10)
Labelstring?What the toolbar is for, for screen readers: "Formatting", "Editor". Optional, as in ARIA; set it when the page has more than one toolbar, so they can be told apart.
AccentAccent = Accent.NeutralThe buttons' accent, unless a button sets its own. Defaults to Neutral.
VariantButtonVariant = ButtonVariant.GhostThe buttons' variant, unless a button sets its own. Defaults to ButtonVariant.Ghost.
SizeControlSize = ControlSize.SmThe buttons' size, unless a button sets its own, and the "…" button's. Defaults to ControlSize.Sm.
Gapint = 2The space between items, in spacing steps (one step = 4px). Defaults to 2.
Wrapbool = falseWraps onto more rows instead of moving items into a "…" menu, for toolbars where everything must show.
CollapseLabelsbool = falseBefore anything moves into the "…" menu, buttons and menus with a StartIcon drop their text, all at once, and show only the icon (a menu keeps its chevron). The text stays for screen readers and, with script, is the tooltip. Items move into the menu only once that isn't enough. One with ToolbarOverflow.Never, such as the main action, keeps its text.
MoreLabelstring? = "More actions"The "…" button's name for screen readers and its tooltip. Defaults to "More actions".
Noncestring? (computed)A CSP nonce for the style element that holds the toolbar's widths. Defaults to the IzzyTheme's Nonce on the page; set it on interactive pages, which don't see the theme's.
ChildContentRenderFragment?The items: ToolbarButton, ToolbarIconButton, ToolbarButtonGroup, ToolbarMenu, ToolbarText, ToolbarItem and ToolbarSeparator.
Plus 16 item props and 4 common props.
Show them hereEvents (0)
No events.
Parts (7)
Components written inside Toolbar, documented here with it.
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.
PositionToolbarPosition = ToolbarPosition.StartWhere it sits. Defaults to ToolbarPosition.Start. Not in a group: set it on the group.
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.
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.
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.
PositionToolbarPosition = ToolbarPosition.StartWhere it sits. Defaults to ToolbarPosition.Start. Not in a group: set it on the group.
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.
IconIconData requiredThe icon.
Labelstring requiredWhat the button does, for screen readers and the tooltip.
Hrefstring?Renders a link to this URL instead of a button.
Submitbool = falseSubmits the form it's in (or Form), when it's a button (not a link), like type="submit".
Resetbool = falseResets the form it's in, when it's a button, like type="reset". Can't be combined with 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).
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).
Plus 16 item props and 4 common props.
ToolbarButtonGroup
A ButtonGroup in a Toolbar, holding ToolbarButtons and ToolbarIconButtons. It moves into the "…" menu as one, as a group named by its Label.
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?What the buttons have in common, for screen readers: "Text alignment".
AccentAccent?The buttons' accent, unless a button sets its own.
VariantButtonVariant?The buttons' variant, unless a button sets its own.
SizeControlSize?The buttons' size, unless a button sets its own.
Attachedbool = trueJoins the buttons into one control with shared borders (the default). False spaces them apart.
OrientationOrientation = Orientation.HorizontalLays the buttons out in a row (the default) or a column.
FullWidthbool = falseStretches the group to its container's width, sharing it among the buttons.
ChildContentRenderFragment?The buttons.
Plus 16 item props and 4 common props.
ToolbarText
Text in a Toolbar, such as "3 selected" or a document's name. It stays in the bar, sized from its text; give it a Width to cut long text short with "…".
PositionToolbarPosition = ToolbarPosition.StartWhere it sits. Defaults to ToolbarPosition.Start.
ChildContentRenderFragment?The text.
Plus 16 item props and 4 common props.
ToolbarItem
Anything that isn't a toolbar control, in a Toolbar: a search field, a SegmentedControl, a Tooltip around a button. Give it a Width, so the widths without script allow for it, and MenuContent for what stands in for it in the "…" menu; without that, it stays in the bar.
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.
ChildContentRenderFragment?The content. Buttons in it are plain Buttons, not toolbar buttons.
Plus 16 item props and 4 common props.
ToolbarSeparator
A vertical line between groups of a Toolbar's items; in its "…" menu, a divider.
PositionToolbarPosition = ToolbarPosition.StartWhere it sits. Defaults to ToolbarPosition.Start.
Plus 4 common props.
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 |
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. |
Orientation
enumWhether items run across or down.
| Value | Description |
|---|---|
Vertical | Top to bottom. |
Horizontal | Side by side, wrapping when space runs out. |
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. |