Skip to content

AccordionSectionWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Represents a single section within an Accordion. Contains the section title, content builder, and action icons.

csharp
public sealed record AccordionSectionWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<AccordionSectionWidget>

Inheritance

ObjectHex1bWidgetAccordionSectionWidget

Implements

Constructors

AccordionSectionWidget(Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>>)

Represents a single section within an Accordion. Contains the section title, content builder, and action icons.

Parameters:

csharp
public AccordionSectionWidget(Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>> ContentBuilder)

Properties

ContentBuilder

A function that builds the section content widgets.

Returns: Func<VStackWidget>, Hex1bWidget>>

csharp
public Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>> ContentBuilder { get; init; }

IsExpanded

Whether this section is expanded. When not explicitly set, the accordion will expand the first section by default.

Returns: Nullable<Boolean>

csharp
public bool? IsExpanded { get; init; }

SectionTitle

The title displayed in the section header.

Returns: String

csharp
public string SectionTitle { get; init; }

Methods

Expanded(bool)

Sets the initial expanded state for this section. When not explicitly set, the accordion expands the first section by default.

Parameters:

  • expanded (Boolean): True to expand, false to collapse.

Returns: AccordionSectionWidget

csharp
public AccordionSectionWidget Expanded(bool expanded = true)

LeftActions(Func<AccordionSectionActionBuilder, IEnumerable<AccordionSectionAction>>)

Adds actions to the left side of the section header. A default toggle chevron is prepended unless a toggle action is included.

Parameters:

Returns: AccordionSectionWidget

csharp
public AccordionSectionWidget LeftActions(Func<AccordionSectionActionBuilder, IEnumerable<AccordionSectionAction>> builder)

RightActions(Func<AccordionSectionActionBuilder, IEnumerable<AccordionSectionAction>>)

Adds actions to the right side of the section header.

Parameters:

Returns: AccordionSectionWidget

csharp
public AccordionSectionWidget RightActions(Func<AccordionSectionActionBuilder, IEnumerable<AccordionSectionAction>> builder)

Title(string)

Sets the title for this section.

Parameters:

  • title (String): The title displayed in the section header.

Returns: AccordionSectionWidget

csharp
public AccordionSectionWidget Title(string title)

Released under the MIT License.