---
title: "custom(_:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/presentationdetent/custom(_:)"
---

# custom(_:)

A custom detent with a calculated height.

## Declaration

```swift
static func custom<D>(_ type: D.Type) -> PresentationDetent where D : CustomPresentationDetent
```

## See Also

### Creating custom detents

- [fraction(_:)](swiftui/presentationdetent/fraction(_:).md)
- [height(_:)](swiftui/presentationdetent/height(_:).md)
- [PresentationDetent.Context](swiftui/presentationdetent/context.md)
