---
title: "height(in:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/custompresentationdetent/height(in:)"
---

# height(in:)

Calculates and returns a height based on the context.

## Declaration

```swift
static func height(in context: Self.Context) -> CGFloat?
```

## Parameters

- `context`: Information that can help to determine the height of the detent.

## Return Value

Return Value The height of the detent, or nil if the detent should be inactive based on the contenxt input.

## See Also

### Getting the height

- [CustomPresentationDetent.Context](swiftui/custompresentationdetent/context.md)
