RippleEffect

April 9, 2026 ยท View on GitHub

A ContentControl that renders a Material-style ripple animation on pointer press. Wrap any control with it to add click feedback.

Basic usage

<RippleEffect>
    <Button Content="Click me" />
</RippleEffect>

Properties

PropertyTypeDefaultDescription
RippleFillIBrushWhiteBrush used to fill the ripple circle (inheritable)
RippleOpacitydouble0.6Opacity of the ripple (inheritable)
RaiseRippleCenterboolfalseWhen true, the ripple always originates from the center instead of the pointer position
IsAllowedRaiseRipplebooltrueEnables or disables the ripple effect entirely
UseTransitionsbooltrueWhether to animate the ripple with easing transitions

Custom color

<RippleEffect RippleFill="{DynamicResource AccentColor}" RippleOpacity="0.4">
    <Border Background="{DynamicResource ControlFillColor1}"
            CornerRadius="8" Padding="16">
        <TextBlock Text="Tap me" />
    </Border>
</RippleEffect>

Center ripple (e.g. icon buttons)

<RippleEffect RaiseRippleCenter="True">
    <PathIcon Data="{DynamicResource HeartRegular}" Width="24" Height="24" />
</RippleEffect>

Disable ripple conditionally

<RippleEffect IsAllowedRaiseRipple="{Binding IsInteractive}">
    <Button Content="Action" />
</RippleEffect>

Notes

  • RippleFill and RippleOpacity are inheritable โ€” set them on a parent container to apply to all nested RippleEffect controls.
  • The ripple uses Avalonia's Composition API and renders on the GPU layer, so it does not affect layout.
  • Only the first pointer contact triggers a ripple; subsequent simultaneous touches are ignored until the first is released.