HtmlForgeX

API Reference

Class

ScrollingText

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Displays a hierarchical scrolling text section with a navigation sidebar.

Inheritance

Remarks

Each ScrollingText instance collects ScrollingTextItem objects which are rendered in order. The control automatically registers the required JavaScript libraries when attached to a document.

Constructors

public ScrollingText() #

Initializes a new instance of the ScrollingText class.

Methods

public ScrollingTextItem AddItem(String title, Action<ScrollingTextItem> contentAction) #
Returns: ScrollingTextItem

Adds a new item to the scrolling text sequence.

Parameters

title System.String requiredposition: 0
Display title for the item.
contentAction System.Action{HtmlForgeX.ScrollingTextItem} requiredposition: 1
Callback used to populate the item contents.

Returns

The created ScrollingTextItem instance.

CreateScrollingDiv() #

Creates the main scrolling div element.

Returns

The scrolling div HtmlTag.

GenerateCustomStyles() #

Generates custom CSS styles based on configuration.

Returns

CSS style rules as a string.

RegisterLibraries() #

Registers the required libraries for ScrollingText.

RenderNav() #

Renders the navigation section for the scrolling text control.

Returns

A navigation HtmlTag element.

RenderNavItem(HtmlForgeX.ScrollingTextItem item) #

Builds a list item for the navigation menu.

Parameters

item HtmlForgeX.ScrollingTextItem required
The item to create a nav link for.

Returns

A HtmlTag representing the navigation entry.

public ScrollingText Settings(Action<ScrollingTextSettings> configure) #
Returns: ScrollingText

Groups less-common options under a single fluent entry point to keep IntelliSense lean.

Parameters

configure System.Action{HtmlForgeX.ScrollingTextSettings} requiredposition: 0
public override String ToString() #
Returns: String

Renders the control as HTML.

Returns

A string containing the rendered HTML.

public ScrollingText WithAlignment(String alignment) #
Returns: ScrollingText

Sets the content alignment (left, center, or auto).

Parameters

alignment System.String requiredposition: 0
The alignment value ("left", "center", or "auto").

Returns

The current instance for method chaining.

public ScrollingText WithCenteredContent() #
Returns: ScrollingText

Centers the content with auto margins.

Returns

The current instance for method chaining.

public ScrollingText WithCompactMode() #
Returns: ScrollingText

Enables compact mode with reduced spacing.

Returns

The current instance for method chaining.

public ScrollingText WithContainer() #
Returns: ScrollingText

Wraps the component in a container for consistent alignment with other page content.

Returns

The current instance for method chaining.

public ScrollingText WithContentWidth(String width) #
Returns: ScrollingText

Sets the content width as a percentage.

Parameters

width System.String requiredposition: 0
The width percentage (e.g., "100%", "80%").

Returns

The current instance for method chaining.

public ScrollingText WithFullWidth() #
Returns: ScrollingText

Sets full-width mode with no margins.

Returns

The current instance for method chaining.

public ScrollingText WithLeftAlignedContent() #
Returns: ScrollingText

Left-aligns the content without auto margins.

Returns

The current instance for method chaining.

public ScrollingText WithMaxWidth(String maxWidth) #
Returns: ScrollingText

Sets the maximum width of the content area.

Parameters

maxWidth System.String requiredposition: 0
The max width value (e.g., "1200px", "80em").

Returns

The current instance for method chaining.

public ScrollingText WithNavigationWidth(String width) #
Returns: ScrollingText

Sets the width of the navigation sidebar.

Parameters

width System.String requiredposition: 0
The width value (e.g., "10em", "200px", "20%").

Returns

The current instance for method chaining.

public ScrollingText WithSectionSpacing(String spacing) #
Returns: ScrollingText

Sets the spacing between sections.

Parameters

spacing System.String requiredposition: 0
The spacing value (e.g., "5rem", "100px").

Returns

The current instance for method chaining.

Properties

public String Id { get; set; } #

Gets a unique identifier for the component.

public List<ScrollingTextItem> Items { get; set; } #

Gets the list of items displayed by the control.

public String NavigationWidth { get; set; } #

Gets or sets the width of the navigation sidebar (default: 15em).

public String SectionSpacing { get; set; } #

Gets or sets the spacing between sections (default: 20rem).

public String MaxWidth { get; set; } #

Gets or sets the maximum width of the content (default: 100em).

public String ContentWidth { get; set; } #

Gets or sets the content width percentage (default: 90%).

public Boolean CompactMode { get; set; } #

Gets or sets whether to use compact spacing (reduces section padding).

public String ContentAlignment { get; set; } #

Gets or sets the content alignment (default: "center" for 90% width, "left" for 100% width).

public Boolean UseContainer { get; set; } #

Gets or sets whether to wrap the entire component in a container for consistent alignment.