Interfaces
This page documents the TypeScript interfaces and type definitions used throughout the ng-magary library.Import Statement
Menu Interfaces
MenuItem
Universal menu item interface used across menu components.Display label for the menu item
Icon name (Lucide icon)
Callback function executed when item is clicked
External URL to navigate to
HTML target attribute for URL links (e.g.,
_blank)Angular router link
Query parameters for router navigation
Route path
Nested menu items (canonical property)
Nested menu items (backward-compatible alias). Prefer
items for new codeWhether the item is expanded (for hierarchical menus)
Whether the item is disabled
Whether the item is visible
Whether this item is a separator
Unique identifier for the item
Badge text to display
Badge severity:
'success' | 'info' | 'warning' | 'danger' | 'contrast'Size of the icon in pixels
Custom CSS class
Custom CSS class for the icon
Custom metadata for the item
Example
BreadcrumbItem
Interface for breadcrumb navigation items.Display label for the breadcrumb
Icon name
Callback function when item is clicked
External URL
Angular router link
Router query parameters
Whether the breadcrumb is disabled
HTML target attribute
Inline styles
Custom CSS class
URL fragment
Whether to preserve the fragment
Whether to skip location change
Whether to replace the URL
Navigation state
Example
Button Interfaces
SpeedDialItem
Interface for speed dial action items.Icon name (Lucide icon)
Tooltip text displayed on hover
Callback function when item is clicked
Unique identifier
ARIA label for accessibility
Custom background color
Whether the item is disabled
Example
Tree Interfaces
MagaryTreeNode
Interface for tree node data structure.Display label for the node
Header text (used in organization chart)
Custom data associated with the node
Icon name
Icon to show when node is expanded
Icon to show when node is collapsed
Child nodes
Whether the node is a leaf node (no children)
Whether the node is expanded
Node type identifier
Reference to parent node
Whether the node is partially selected (some children selected)
Custom CSS class
Whether the node can be dragged
Whether other nodes can be dropped on this node
Whether the node can be selected
Unique key for the node
Example
MagaryTreeSelectionValue
Type for tree selection state.MagaryTreeNodeSelectionEvent
Event emitted when a tree node is selected or unselected.Original DOM event
The selected/unselected node
MagaryTreeNodeDropEvent
Event emitted when a node is dropped (drag and drop).Original CDK drag-drop event
The parent node where the drop occurred
The node that was dragged
Table Interfaces
MagaryTableColumn
Interface for table column configuration.Field name to display (supports nested fields with dot notation)
Column header text
Column data type for rendering
Whether the column is sortable
Column width (CSS value)
Example
MagaryTableSortState
Interface for table sort state.Field being sorted
Sort order:
-1 (descending), 0 (none), 1 (ascending)Toast Interfaces
Toast
Interface for toast notification configuration.Unique identifier (auto-generated if not provided)
Toast severity type
Toast title
Toast message content
Custom icon name (overrides default type icon)
Duration in milliseconds before auto-dismiss
Alias for
durationIf true, toast will not auto-dismiss
Custom data payload
Example
Paginator Interfaces
PaginatorState
Interface for paginator state and events.Index of the first row
Number of rows per page
Current page number (0-indexed)
Total number of pages
Type Definitions
Theme
Supported theme names forMagaryThemeService.
MenuBadgeSeverity
Badge severity levels for menu items.See Also
- Exports - Complete list of all exported components and services
- Components - Detailed component documentation
