Logo

dev-resources.site

for different kinds of informations.

Introducing the New .NET MAUI Bottom Sheet Control

Published at
1/15/2025
Categories
netmaui
development
mobile
ui
Author
phinteratienoo
Categories
4 categories in total
netmaui
open
development
open
mobile
open
ui
open
Author
14 person written this
phinteratienoo
open
Introducing the New .NET MAUI Bottom Sheet Control

TL;DR: Let’s see how the Syncfusion® .NET MAUI Bottom Sheet elevates app functionality with dynamic height, interactive gestures, and customizable content. Ideal for menus, quick actions, and overlays, this sliding panel integrates seamlessly with themes and supports popup mode for focus. Explore its adaptability for hosting lists, forms, or grids with enhanced theming options.

We’re excited to introduce the new Bottom Sheet control in the Syncfusion® .NET MAUI toolkit. You can explore this control on NuGet or in our GitHub repository.

The Bottom Sheet is a sliding panel anchored at the bottom of the screen, commonly used in mobile and desktop applications. It allows users to access secondary information or perform actions while maintaining the context of the underlying content. Typical use cases include displaying menus, additional settings, or detailed views of list items.

Key features of the .NET MAUI Bottom Sheet control

Dynamic height customization

The .NET MAUI Bottom Sheet allows seamless height adjustment to fit various screen states, such as Hidden, Collapsed, Half Expanded, and Full Expanded. This feature enables developers to dynamically configure these states using properties like FullExpandedRatio, HalfExpandedRatio, and CollapsedHeight. This ensures optimal use of screen space for different content scenarios.

Refer to the following image.

Bottom Sheet Control with Half state Dynamic Height Customization
Half state
Bottom Sheet Control with Full state Dynamic Height Customization
Full state
Bottom Sheet Control with Collapsed state Dynamic Height Customization
Collapsed state

Dynamic height customization in .NET MAUI Bottom Sheet

Expanding and collapsing

When the user experience demands explicit control over the Bottom Sheet’s state, .NET MAUI provides programmatic options to manage it effectively. Using the IsOpen property or the Show and Close methods, you can dynamically control whether the Bottom Sheet should be displayed.

Interactive gestures

Interactive gestures enable users to intuitively drag the Bottom Sheet upwards or downwards, transitioning between collapsed, half-expanded, and fully expanded states.

Refer to the following image.

Interactive gestures in .NET MAUI Bottom Sheet control


Interactive gestures in .NET MAUI Bottom Sheet control

Customizable content

The .NET MAUI Bottom Sheet serves as an adaptable container capable of hosting various types of content. This makes it ideal for numerous use cases. Whether you wish to incorporate lists, grids, forms, images, or custom layouts, the Bottom Sheet offers the flexibility to tailor its content to fit your app’s requirements.

Customizable content in .NET MAUI Bottom Sheet


Customizable content in .NET MAUI Bottom Sheet

Popup mode

In certain scenarios, it is crucial to ensure that users are focused solely on the Bottom Sheet’s content by disabling interactions with the background. This is especially useful for modal-like Bottom Sheets where critical information or actions require undivided attention.

Theming and styling

The Bottom Sheet seamlessly integrates with your app’s theme, ensuring a consistent look and feel throughout the user interface. It adapts dynamically to light and dark modes, maintaining readability, usability, and aesthetic harmony.

Light theme
Light theme
Dark theme
Dark theme

Use cases and apps

Consider using the .NET MAUI Bottom Sheet control for a variety of scenarios:

  1. Profile overlays: Allow users to view or edit profiles without leaving the main screen.
  2. Quick actions: Display action menus to streamline user navigation.
  3. Expandable playlists or notifications: Present music playlists, notifications, or task details without intrusive screen transitions.

Note: For more details, refer to the .NET MAUI Bottom Sheet documentation.

Getting started with the .NET MAUI Bottom Sheet control

Let’s see how to integrate the .NET MAUI Bottom Sheet control into your app.

Step 1: Create a .NET MAUI project

Begin by creating a .NET MAUI project.

Step 2: Add the Syncfusion® .NET MAUI MAUI toolkit package

Syncfusion® .NET MAUI toolkit controls are available on the NuGet Gallery. In Visual Studio, open the NuGet package manager, search for Syncfusion.Maui.Toolkit, and install it.

Step 3: Register the handler

In the MauiProgram.cs file, register the handler for Syncfusion® .NET MAUI Toolkit. Refer to the following code example.

using Syncfusion.Maui.Toolkit.Hosting;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .ConfigureSyncfusionToolkit()
            .UseMauiApp<App>()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

        return builder.Build();
    }
}
Enter fullscreen mode Exit fullscreen mode

Step 4: Add the namespace

Include the Syncfusion.Maui.Toolkit.BottomSheet namespace in your XAML page.

XAML

xmlns:bottomSheet="clr-namespace:Syncfusion.Maui.Toolkit.BottomSheet;assembly=Syncfusion.Maui.Toolkit"
Enter fullscreen mode Exit fullscreen mode

Step 5: Initialize the Syncfusion® .NET MAUI Bottom Sheet control

Now, initialize the Syncfusion® .NET MAUI Bottom Sheet control.

<bottomSheet:SfBottomSheet x:Name="bottomSheet" />
Enter fullscreen mode Exit fullscreen mode

Step 6: Set content to the .NET MAUI Bottom Sheet control

Refer to the following code example to configure the main content for the Bottom Sheet control.

<bottomSheet:SfBottomSheet x:Name="bottomSheet" CollapsedHeight="180">
  <bottomSheet:SfBottomSheet.Content>
    <Grid>
      <ListView x:Name="ListView" ItemsSource="{Binding Items}" RowHeight="105" 
                      ItemTapped="OnListViewItemTapped">
          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell>
                <Grid ColumnDefinitions="auto, *, 50” ColumnSpacing="0" Padding="16">
                  <Border StrokeThickness="0">
                    <Border.StrokeShape>
                      <RoundRectangle CornerRadius="10" />
                    </Border.StrokeShape>
                    <Image Source="{Binding ImageName}" />
                  </Border>
                  <VerticalStackLayout Grid.Column="1" Spacing="2" Padding="16,0,0,0">
                    <Label Text="{Binding FoodName}" FontSize="20" FontAttributes="Bold" FontFamily="Roboto"/>
                    <Label Text="{Binding SubName}" FontSize="16" FontFamily="Roboto" />
                    <Label Text="{Binding Description}" FontSize="12" LineBreakMode="TailTruncation" MaxLines="2" FontFamily="Roboto"/>
                  </VerticalStackLayout>
                  <Label Text="{Binding Price, StringFormat='${0}'}" FontAttributes="Bold" FontSize="20" FontFamily="Roboto" VerticalOptions="Center" HorizontalOptions="Center" Grid.Column="2" />
                </Grid>
             </ViewCell>
           </DataTemplate>
         </ListView.ItemTemplate>
       </ListView>
    </Grid>
  </bottomSheet:SfBottomSheet.Content>

</bottomSheet:SfBottomSheet>
Enter fullscreen mode Exit fullscreen mode

Refer to the following code example to customize the Bottom Sheet control.

<bottomSheet:SfBottomSheet x:Name="bottomSheet" CollapsedHeight="180">
    <bottomSheet:SfBottomSheet.Content>
      <!--Add your content-->
    </bottomSheet:SfBottomSheet.Content>

    <bottomSheet:SfBottomSheet.BottomSheetContent>
      <Grid RowDefinitions="auto, *, 80" x:Name="Grid">
        <Grid RowDefinitions="*, auto">
          <VerticalStackLayout>
            <Label>
              <Label.FormattedText>
                <FormattedString>
                    <Span Text="{Binding FoodName, StringFormat='{0} Pizza'}" FontAttributes="None"/>
                    <Span Text=" - " FontAttributes="None" />
                    <Span Text="{Binding Price, StringFormat='${0}'}" />
                </FormattedString>
              </Label.FormattedText>
            </Label>
            <Label Text="Customise as per your taste" FontSize="22" FontAttributes="Bold" FontFamily="Roboto"/>
          </VerticalStackLayout>
          <Border HeightRequest="2" Grid.Row="1" Margin="0, 10,0,5"/>
       </Grid>
     </Grid>
  </bottomSheet:SfBottomSheet.BottomSheetContent>
</bottomSheet:SfBottomSheet>
Enter fullscreen mode Exit fullscreen mode

Refer to the following image.

Integrating Bottom Sheet control in .NET MAUI app


Integrating Bottom Sheet control in .NET MAUI app

GitHub reference

For more details, refer to the .NET MAUI Bottom Sheet control demo on GitHub.

Conclusion

Thanks for reading! In this blog, we’ve explored the features of the new Syncfusion® .NET MAUI Bottom Sheet control. This powerful tool is for developers looking to enhance the intuitiveness and functionality of their apps.

For additional controls and advanced features, consider exploring the complete suite of Essential Studio® for .NET MAUI controls. This suite includes robust line-of-business controls like DataGrid, ListView, and Scheduler, all designed to ensure seamless integration and enhance your development experience.

If you have any questions or require assistance, you can contact us through our support forums, support portal, or feedback portal. We are always happy to assist you!

Related Blogs

development Article's
30 articles in total
Development refers to the process of building, improving, and maintaining software, websites, and systems.
Favicon
Top 10 Online Postman-Like Tools for API Testing and Development
Favicon
Singularity: Streamlining Game Development with a Universal Framework
Favicon
How to develop ecommerce website using WooCommerce plugin?
Favicon
The Perils of Presumption: Why Making Assumptions in Development is Bad
Favicon
Introducing the New .NET MAUI Bottom Sheet Control
Favicon
Solving Circular Dependencies: A Journey to Better Architecture
Favicon
Aumente seu leque de ferramentas no desenvolvimento com um exemplo prático usando MoSCoW
Favicon
Top 50 Websites a Backend Developer Must Know 🖥️🔧🚀
Favicon
Moving Apple Music MP3 Playlists To Android
Favicon
Expanded literacy and the current state of software
Favicon
Here are 7 Regex tools that can save your life from hell 🔥
Favicon
Level Up Your Architecture Game with Monolithic Modular - It's Not What You Think
Favicon
How to Fix the “Record to Delete Does Not Exist” Error in Prisma
Favicon
How to Enable JavaScript on iPhone
Favicon
End-to-End API Testing: How Mocking and Debugging Work Together
Favicon
The first part of this MASSIVE series about software architecture patterns is OUT!! please check it out!!
Favicon
And... We're Off!
Favicon
projects and apps
Favicon
Designing Context for New Modules in HyperGraph
Favicon
TOP 10 TYPES OF DOCKER COMMANDS
Favicon
Elevate Your Brand with Expert Craft CMS Solutions
Favicon
Why Facing Your Fears Makes You a Cool (and Confident) Developer
Favicon
Digital Signage: Your Key to Captivating Customers
Favicon
🚀 I have released Eurlexa!!! EU Regulation at Your Fingertips!
Favicon
Master Advanced Techniques in Prompt Engineering Today!
Favicon
Build Faster and Smarter with Containerized Development Environments
Favicon
Grow your startup business with TechnBrains App Development.
Favicon
🐈‍⬛ Git and GitHub: A Beginner’s Guide to Version Control 🚀
Favicon
10 Tailwind CSS Dropdowns - Free and Open-Source
Favicon
Meilleurs proxy anonymes pour le torrent et la confidentialité

Featured ones: