Blazorise Bar API
Explore the Blazorise Bar API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Bar documentation.
API
Parameters
Bar
| Parameter | Default | Type |
|---|---|---|
Alignment | Alignment.Default | Alignment |
Specifies the alignment within bar. Possible values: DefaultStartCenterEnd | ||
Breakpoint | None | Breakpoint |
Used for responsive collapsing. Possible values: NoneMobileExtraSmallTabletSmallDesktopMediumWidescreenLargeFullHDExtraLargeQuadHDExtraExtraLarge | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Bar. | ||
CollapseMode | BarCollapseMode.Hide | BarCollapseMode |
Specifies how the bar will be collapsed. Possible values: HideSmall | ||
MenuToggleBehavior | AllowMultipleMenus | BarMenuToggleBehavior |
Specifies how the bar menu will behave when toggled. Possible values: AllowSingleMenuAllowMultipleMenus | ||
Mode | BarMode.Horizontal | BarMode |
Specifies the orientation for the bar. Vertical* is required when using as a Sidebar.Possible values: HorizontalVerticalPopoutVerticalInlineVerticalSmall | ||
NavigationBreakpoint | None | Breakpoint |
Used for responsive collapsing after Navigation. Possible values: NoneMobileExtraSmallTabletSmallDesktopMediumWidescreenLargeFullHDExtraLargeQuadHDExtraExtraLarge | ||
ThemeContrast | Light | ThemeContrast |
Specifies the preferred theme contrast for this Bar component. Possible values: NoneLightDark | ||
Visible | true | bool |
Controls the state of toggler and the menu. | ||
BarLink
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this BarLink. | ||
Match | All | Match |
URL matching behavior for a link. Possible values: PrefixAll | ||
Target | Target.Default | Target |
The target attribute specifies where to open the linked document. | ||
Title | — | string |
Specify extra information about the element. | ||
To | — | string |
Specifies the URL of the page the link goes to. | ||
BarDropdownToggle
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Link. | ||
Disabled | false | bool |
Makes the link look inactive by adding the disabled boolean attribute. | ||
Indentation | 1.5d | double |
Determines how much left padding will be applied to the dropdown toggle. (in rem unit) | ||
Match | Match.Prefix | Match |
URL matching behavior for a link. Possible values: PrefixAll | ||
ShowToggleIcon | true | bool? |
Specifies a value indicating whether the dropdown toggle icon is visible. When unspecified, uses the theme setting, falling back to true. | ||
Stretched | false | bool |
Makes any HTML element or component clickable by “stretching” a nested link. | ||
TabIndex | null | int? |
Specifies whether the link element can be focused and where it participates in sequential keyboard navigation. | ||
Target | Target.Default | Target |
The target attribute specifies where to open the linked document. | ||
Title | — | string |
Specify extra information about the element. | ||
To | — | string |
Denotes the target route of the link. | ||
ToggleIconVisible | true | bool? |
Specifies a value indicating whether the dropdown toggle icon is visible. This parameter is retained for source compatibility. Use ShowToggleIcon instead. When unspecified, uses the theme setting, falling back to true. | ||
Trigger | Auto | BarDropdownToggleTrigger |
Specifies which interactions can trigger the dropdown toggle. Possible values: AutoToggleClickIconClickClickAnyRouteMatchAll | ||
Unstyled | false | bool |
Removes default color styles from the link. | ||
Events
Bar
| Event | Type |
|---|---|
VisibleChanged | EventCallback<bool> |
Notifies when the bar visibility changes. | |
BarLink
| Event | Type |
|---|---|
Clicked | EventCallback<MouseEventArgs> |
Notifies when the item is clicked. | |
CustomMatch | Func<string, bool> |
A callback function that is used to compare current uri with the user defined uri. If defined, the Match parameter will be ignored. | |
BarDropdownToggle
| Event | Type |
|---|---|
Clicked | EventCallback<MouseEventArgs> |
Notifies when the link is clicked. | |
CustomMatch | Func<string, bool> |
A callback function that is used to compare current uri with the user defined uri. If defined, the Match parameter will be ignored. | |
Methods
Bar
| Method | Return | Parameters |
|---|---|---|
HideAllExcept | Task | BarItem barItem |
Hides all items except the one that is passed as a parameter.
| ||
Toggle | Task | — |
Toggles the Visible state of the Bar component.
| ||
BarDropdownToggle
| Method | Return | Parameters |
|---|---|---|
Close | Task | CloseReason closeReason |
Triggers the closable component to be closed.
| ||
IsSafeToClose | Task<bool> | string elementId, CloseReason closeReason, bool isChildClicked |
Finds if the closable component is ready to be closed.
| ||