# computeDetentHeights

The visible height of each detent for a viewport, in whole pixels.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { computeDetentHeights } from "@mapcairn/core";
 
function computeDetentHeights(input: {
    viewportHeight: number;
    insetBottom: number;
}): DetentHeights;
```

## Parameters

- `input` (`{
    viewportHeight: number;
    insetBottom: number;
}`): The fields, by name:
   - `viewportHeight`: Height of the visual viewport.
   - `insetBottom`: Bottom safe-area inset. It is added to the peek
   so the peek's content is not hidden behind a home indicator.

## Returns

`DetentHeights`

## Remarks

The result is always ordered `peek <= half <= full`, even on a
 very short viewport, so snapping never has to deal with crossed detents.

## See also

- [`DetentHeights`](https://docs.mapcairn.com/api/core/DetentHeights.md)

Source: [packages/core/src/sheet/sheet.ts:48](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/sheet/sheet.ts#L48)
