Class CustomNavigationToolbarItem
Represents a custom item that can be added to the navigation toolbar of the SfPdfViewer2 component.
Inheritance
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class CustomNavigationToolbarItem : Object
Remarks
The CustomNavigationToolbarItem class is used to define user-specific toolbar items within the navigation panel. It includes properties for positioning, naming, styling, and templating each custom item. These items can enhance the toolbar with additional functionality beyond built-in options.
Examples
The following example demonstrates how to configure custom navigation toolbar items in the PDF Viewer:
@code {
List<CustomNavigationToolbarItem> CustomItems = new List<CustomNavigationToolbarItem> {
new CustomNavigationToolbarItem {
Index = 2,
Name = "Search",
TooltipText = "Search Document",
IconCss = "e-pv-search",
ItemType = NavigationToolbarItemType.Button
}
};
}
Constructors
CustomNavigationToolbarItem()
Provides the Name for the new Navigation Toolbar Item Added
Declaration
public CustomNavigationToolbarItem()
Properties
HeaderText
Gets or sets the header text displayed at the top of the panel.
Declaration
public string HeaderText { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the header title for the panel. |
Remarks
Useful for identifying the panel's purpose and improving user navigation. Header text is typically shown prominently and helps users understand the context of the panel.
Examples
var panel = new CustomNavigationToolbarItem { HeaderText = "User Details" };
IconCss
Gets or sets the CSS class used for rendering the icon of the custom toolbar item.
Declaration
public string IconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String specifying the CSS class used to style the toolbar icon. |
Remarks
You can assign a custom icon using a valid CSS class. This class should point to a font icon or SVG that visually represents the item.
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem { IconCss = "e-pv-note" };
Index
Gets or sets the index position of the custom item within the navigation toolbar.
Declaration
public int Index { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An System.Int32 indicating the item’s position in the toolbar. |
Remarks
This property determines where the item appears relative to other toolbar elements. A lower index places the item earlier in the toolbar. Duplicate indices may affect layout ordering.
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem { Index = 1 };
ItemType
Gets or sets the type of the navigation toolbar item. Determines whether it behaves as a clickable button or a visual separator.
Declaration
public NavigationToolbarItemType ItemType { get; set; }
Property Value
Type | Description |
---|---|
NavigationToolbarItemType | A NavigationToolbarItemType value that defines the item's role in the toolbar. |
Remarks
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem { ItemType = NavigationToolbarItemType.Separator };
Name
Gets or sets the custom name assigned to the navigation toolbar item.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the item's name. |
Remarks
This name serves as an identifier and can be used in data binding or toolbar configuration logic.
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem { Name = "Notes" };
Template
Gets or sets the custom template for rendering the navigation toolbar item.
Declaration
public RenderFragment Template { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | A Microsoft.AspNetCore.Components.RenderFragment representing the visual layout of the item. |
Remarks
This property allows you to define a full custom layout using a Microsoft.AspNetCore.Components.RenderFragment. Useful when default rendering needs to be overridden with custom content such as buttons or controls.
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem {
Template = builder => {
builder.AddContent(0, "Custom Button");
}
};
TooltipText
Gets or sets the tooltip text displayed when hovering over the custom toolbar item.
Declaration
public string TooltipText { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the tooltip description for the item. |
Remarks
Helpful for improving accessibility and conveying item functionality to users. Tooltips appear on mouse hover and can enhance the user experience.
Examples
CustomNavigationToolbarItem item = new CustomNavigationToolbarItem { TooltipText = "Add Notes" };