CommunityToolkit / CommunityToolkit/Maui
[Proposal] Expander animation
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### Feature name
Expander updated to support animation via a new ExpanderAnimationBehavior
```c#
public partial class ExpanderAnimationBehavior : BaseBehavior, IExpansionController
{
[BindableProperty] public partial Easing CollapsingEasing { get; set; } = Easing.Linear;
[BindableProperty] public partial uint CollapsingLength { get; set; } = 250u;
[BindableProperty] public partial Easing ExpandingEasing { get; set; } = Easing.Linear;
[BindableProperty] public partial uint ExpandingLength { get; set; } = 250u;
// ...
}
```
### Link to discussion
https://github.com/CommunityToolkit/Maui/discussions/1628
### Progress tracker
- [x] Android Implementation
- [x] iOS Implementation
- [x] MacCatalyst Implementation
- [x] Windows Implementation
- [ ] Tizen Implementation
- [x] Unit Tests
- [x] Samples
- [ ] Documentation (TODO)
### Summary
This issue and the corresponding PR is to continue a conversation that started in the discussion forums on how we may introduce animations to the Expander component.
### Motivation
The Expander component could be improved to support animation.
### Detailed Design
[Feb 15, 2025, Original Design]
[April 5, 2025, Refactor/Rewrite]
[March 2, 2026, Refactor/Rewrite]
Wrap the user's `Expander.Content` inside a new `Expander.ContentHost` (ContentView) so that we can implement expanding/collapsing animation by manipulating `Expander.ContentHost.HeightRequest`.
Usage:
```xaml
```
### Drawbacks
_No response_
### Unresolved Questions
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.