viewportHeight property

  1. @override
double? get viewportHeight
override

The current height of the visible area of the Mini App. Also available in CSS as the variable var(--tg-viewport- height).

The application can display just the top part of the Mini App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Mini App to its maximum height, while the bot can do the same by calling the expand() method. As the position of the Mini App changes, the current height value of the visible area will be updated in real time.

Please note that the refresh rate of this value is not sufficient to smoothly follow the lower border of the window. It should not be used to pin interface elements to the bottom of the visible area. It's more appropriate to use the value of the viewportStableHeight field for this purpose.

Implementation

@override
double? get viewportHeight => 548.0;