Expander

Note: You can check the Avalonia docs for the Expanderarrow-up-right and Expander APIarrow-up-right if you need more information.

For Avalonia.FuncUI's DSL properties you can check Expander.fsarrow-up-right

The Expander (known as accordion as well) is a control that allows a user to show or hide content to make more room for relevant information or to show detailed information about the current view

Usage

Set Label

Expander.create [
    Expander.header "Check Logs"
    // the Logs property may be an extremely long text that's why we use an expander
    // hide the logs unless you want to see them
    Expander.content (TextBlock.create [ TextBlock.text state.Logs ])
]

Change Expand Direction you can set in which direction the content should flow

Expander.create [
    Expander.groupName "newsletter"
    Expander.content expanderContent
    // ExpandDirection.Up
    // ExpandDirection.Down
    // ExpandDirection.Left
    // ExpandDirection.Right
    Expander.expandDirection ExpandDirection.Up
]

Use Different Transitions

Use Multiple Expanders you can use multiple expanders and open them programatically via their isExpanded property

Last updated