Skip to content

AccordionWidget ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A collapsible section container where each section has a title header and expandable content area. Sections can be expanded and collapsed independently.

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

Inheritance ​

Object → Hex1bWidget → AccordionWidget

Implements ​

Constructors ​

AccordionWidget(IReadOnlyList<AccordionSectionWidget>) ​

A collapsible section container where each section has a title header and expandable content area. Sections can be expanded and collapsed independently.

Parameters:

csharp
public AccordionWidget(IReadOnlyList<AccordionSectionWidget> Sections)

Properties ​

AllowMultipleExpanded ​

Whether multiple sections can be expanded simultaneously. Defaults to false.

Returns: Boolean

csharp
public bool AllowMultipleExpanded { get; init; }

Sections ​

The list of sections to display.

Returns: IReadOnlyList<AccordionSectionWidget>

csharp
public IReadOnlyList<AccordionSectionWidget> Sections { get; init; }

Methods ​

MultipleExpanded(bool) ​

Sets whether multiple sections can be expanded simultaneously. When false, expanding one section collapses all others.

Parameters:

Returns: AccordionWidget

csharp
public AccordionWidget MultipleExpanded(bool allow = true)

OnSectionExpanded(Action<AccordionSectionExpandedEventArgs>) ​

Sets a synchronous handler for section expand/collapse changes.

Parameters:

Returns: AccordionWidget

csharp
public AccordionWidget OnSectionExpanded(Action<AccordionSectionExpandedEventArgs> handler)

OnSectionExpanded(Func<AccordionSectionExpandedEventArgs, Task>) ​

Sets an asynchronous handler for section expand/collapse changes.

Parameters:

Returns: AccordionWidget

csharp
public AccordionWidget OnSectionExpanded(Func<AccordionSectionExpandedEventArgs, Task> handler)

Fields ​

ClickAction ​

Returns: ActionId

csharp
public static readonly ActionId ClickAction

FocusNextAction ​

Returns: ActionId

csharp
public static readonly ActionId FocusNextAction

FocusPreviousAction ​

Returns: ActionId

csharp
public static readonly ActionId FocusPreviousAction

NextSectionAction ​

Returns: ActionId

csharp
public static readonly ActionId NextSectionAction

PreviousSectionAction ​

Returns: ActionId

csharp
public static readonly ActionId PreviousSectionAction

ToggleSectionAction ​

Returns: ActionId

csharp
public static readonly ActionId ToggleSectionAction

Examples ​

csharp
ctx.Accordion(a => [
    a.Section(s => [s.Text("File list")]).Title("Explorer"),
    a.Section(s => [s.Text("Outline")]).Title("Outline"),
    a.Section(s => [s.Text("Timeline")]).Title("Timeline")
])

Released under the MIT License.