Skip to main content

Open-WebUI-Functions is here! New Pipelines, Filters, and more. Learn more

Separator Control

Separator

You can use the separator to separate elements from each other. This separates the elements with a horizontal line. This can then look like this:

custom-separator

Key features

  • Lightweight control that renders a simple BoxView, making it easy to theme.
  • Bindable Color property so you can adapt to different sections or accent palettes.
  • Minimal layout margin ensures consistent spacing between settings rows.

Here is the corresponding code for it:

Style

Color.xaml
<Color x:Key="Gray200">#C8C8C8</Color>
<Color x:Key="Gray600">#404040</Color>

How to use

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:elements="using:App.Elements">
<StackLayout>
<elements:Button IconSource="{fluent:Icon Icon=Person48}"
Text="User" />
<elements:Separator />
<elements:Button IconSource="{fluent:Icon Icon=Wifi120}"
Text="Connections" />
<elements:Separator />
<elements:Button IconSource="{fluent:Icon Icon=Options48}"
Text="Personalisation" />
</StackLayout>
</ContentPage>

NuGet Packages

Implementation notes

  • Bind the Color property to theme resources to maintain consistent contrast across light and dark palettes.
  • When stacking multiple separators, adjust the surrounding layout margins rather than changing the control height so screen readers continue to perceive it as decorative.
  • If you host the separator inside a CollectionView, mark it as IsVisible="False" for the first item to avoid an extra line at the top of the list.