TextBreadcrumbs
Description
The TextBreadcrumbs component is used as a navigational container that aggregates multiple TextBreadcrumb components. It displays a series of navigational links (breadcrumbs) that help users understand their current location within a hierarchical structure. Use this component when you want to provide users with one-click access to higher levels in your app's navigation hierarchy.
Usage
Instantiate TextBreadcrumbs using the static helper method from Tesserae.UI. Chain the Items() method to add individual TextBreadcrumb elements. The component supports method chaining and fluent interface conventions.
Methods
Clear()
Clears all the child breadcrumb elements from the container.
Parameters: None.Replace(TextBreadcrumb newComponent, TextBreadcrumb oldComponent)
Replaces an existing breadcrumb with a new one in the container.
Parameters:- newComponent: The new TextBreadcrumb component to be added.
- oldComponent: The existing TextBreadcrumb component to be replaced.
Add(TextBreadcrumb component)
Adds a new TextBreadcrumb element to the container.
Parameters:- component: The TextBreadcrumb to be added.
Items(params TextBreadcrumb[] children)
Adds multiple TextBreadcrumb items at once to the container.
Parameters:- children: A variable number of TextBreadcrumb components.
Render()
Renders the HTML element of the TextBreadcrumbs container.
Parameters: None.
Returns: HTMLElement.
Properties
Size (TextSize)
Gets or sets the text size by adding or removing appropriate CSS classes.
Type: TextSize
Default: TextSize.SmallWeight (TextWeight)
Gets or sets the text weight by manipulating CSS classes.
Type: TextWeight
Default: TextWeight.RegularTextAlign (TextAlign)
Provides text alignment settings. This property is available but not implemented in the current version.
Type: TextAlignForeground (string)
Gets or sets the foreground color of the breadcrumbs container by directly manipulating its style.
Type: string
Samples
Basic Breadcrumbs Usage
This sample demonstrates how to create a TextBreadcrumbs container with a series of TextBreadcrumbs items. Each TextBreadcrumb fires an event on click that can be used to update UI or perform custom logic.