# .NET MAUI BottomSheet Configuration

The Telerik UI for .NET MAUI BottomSheet control offers flexible configuration options for states, dimensions, and visual elements. You can define custom states with specific heights, control the sheet's dimensions using absolute or percentage values, and customize the draggable handle to match your application's design.

## States

The BottomSheet control provides a flexible state system that determines how much of the screen the component occupies. You can use predefined states or create custom ones to present content at different visibility levels.

### Predefined States

The control includes four built-in states with predefined heights:

* `Hidden` (default)—Represents a completely hidden bottom sheet.
* `Minimal`—Represents a minimal bottom sheet state with height `25%`.
* `Partial`—Represents a partial bottom sheet state with height `50%`.
* `Full`—Represents a full bottom sheet state with height `90%`.

  ![Telerik UI for .NET MAUI BottomSheet showing Hidden, Minimal, Partial, and Full states with different panel heights](https://www.telerik.com/maui-ui/documentation/assets/923f4ecccd64c96223e03b560dcf8142/bottomsheet-states.png)

### Setting States

You can specify the current state using the `State` property of type `BottomSheetState`:

```xaml
<telerik:RadBottomSheet x:Name="bottomSheet" 
                        State="Partial">
    
</telerik:RadBottomSheet>
```

### Custom States

You can control the generation of default states using the `AutoGenerateStates` (`bool`) property. The default value is `true`, which means the four predefined states are populated in the `States` collection.

```xaml
<telerik:RadBottomSheet AutoGenerateStates="False" />
```

Create custom states using the `BottomSheetState` class constructors:

* Using `BottomSheetLength`

```csharp
public BottomSheetState(string name, BottomSheetLength height)
```

* Using `double` value

```csharp
public BottomSheetState(string name, double size, bool isPercentage = false)
```

Example of creating custom states:

```csharp
// Custom state with 30% height
var customState = new BottomSheetState("Custom", 30, true);

// Custom state with absolute height = 200
var fixedState = new BottomSheetState("Fixed", 200, false);
```

### Programmatic State Changes

Use the [`GoToBottomSheetState(string name)` method](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/methods) to programmatically change states:

Here is an example setting the predefined name of the state inside the `GoToBottomSheetState(string name)` method:

```C#
private void OnOpenClicked(object sender, System.EventArgs e)
{
	this.bottomSheet.GoToBottomSheetState(BottomSheetState.PartialStateName);
}
```

Here is an example setting a custom state:

```csharp
// Navigate to custom states
var customState = new BottomSheetState("Custom", 30, true);
bottomSheet.GoToBottomSheetState("Custom");
```

### States Collection

The BottomSheet provides a read-only `States` collection of type `ObservableCollection<BottomSheetState>` that contains all available states for the bottom sheet, including both predefined and custom states.

> For a runnable example with setting the BottomSheet States, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to **BottomSheet > Features** category.

## Width

You can specify the width for the bottom sheet content using the `BottomSheetContentWidth` property of type `BottomSheetLength`. The `BottomSheetLength` structure supports both absolute and percentage values:

```xaml

<telerik:RadBottomSheet BottomSheetContentWidth="80%">
    
</telerik:RadBottomSheet>


<telerik:RadBottomSheet BottomSheetContentWidth="300">
    
</telerik:RadBottomSheet>
```

```csharp
// Using percentage
bottomSheet.BottomSheetContentWidth = new BottomSheetLength(80, true);

// Using absolute value
bottomSheet.BottomSheetContentWidth = new BottomSheetLength(300, false);
```

Here is an example setting the width of the `BottomSheetContent` to 400 (absolute value) and 50%:

![Telerik UI for .NET MAUI BottomSheet changing content width between an absolute 400 pixels and 50 percent](https://www.telerik.com/maui-ui/documentation/assets/857c771af2dd2af7a4d8c510d3ddd8a0/bottomsheet-width.gif)

> For a runnable example with setting the BottomSheet Width, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to **BottomSheet > Features** category.

## Handle

The BottomSheet exposes a visual cue which indicates the control can be dragged. You can customize the handle by using the `HandleStyle` (`Style` with target type `BottomSheetHandle`) property.

## Gesture Threshold

Use the `StateChangeThreshold` (`double`) property to control how far the user needs to drag the BottomSheet before it changes to the next state. The default value is `0.15`.

Lower values make the BottomSheet switch states more easily. Higher values require a longer drag gesture before the next state is applied.

For more details, review the [BottomSheet Handle Styling](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/styling#handle-styling) article.

## See Also

* [Animation when opening and closing the bottom sheet](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/animation)
* [Style the BottomSheet](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/styling)
* [Events](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/events)
* [Methods](https://www.telerik.com/maui-ui/documentation/controls/bottomsheet/methods)
