Expander
Description
A single expand / collapse section, with a clickable header that reveals its body content. Used standalone for "show more" affordances, or grouped inside an Accordion.
Usage
API reference
public sealed class Expander : ComponentBase<Expander, HTMLElement>A single expand / collapse section, with a clickable header that reveals its body content.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<Expander, HTMLElement> → Expander
Constructors
| Name | Description |
|---|---|
| Expander | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| IsExpanded | Gets or sets whether the expander is expanded. |
| Title | Gets or sets the title text when no custom header is provided. |
public bool IsExpanded { get ; set ; }Gets or sets whether the expander is expanded.
Methods
| Name | Description |
|---|---|
| SetTitle | Sets the title of the component. |
| SetHeader | Sets the header of the component. |
| SetContent | Sets the content of the component. |
| OptionIcon | Configures the option icon on the component. |
| ChevronRight | Configures the chevron right on the component. |
| Expanded | Expands the component. |
| Collapse | Collapses the component. |
| Expand | Expands the component. |
| Toggle | Toggles the component's state. |
| OnToggle | Registers a callback invoked when the toggle event fires. |
| OnExpand | Registers a callback invoked when the expand event fires. |
| OnCollapse | Registers a callback invoked when the collapse event fires. |
| Render | Renders the component's root HTML element. |
public Expander SetHeader(IComponent header)Sets the header of the component.
public Expander SetContent(IComponent content)Sets the content of the component.
public Expander OptionIcon(UIcons icon, string color = "", string background = "")Configures the option icon on the component.
public Expander ChevronRight()Configures the chevron right on the component.
public Expander OnToggle(Action<Expander> onToggle)Registers a callback invoked when the toggle event fires.
public Expander OnExpand(Action<Expander> onExpand)Registers a callback invoked when the expand event fires.
public Expander OnCollapse(Action<Expander> onCollapse)Registers a callback invoked when the collapse event fires.