# How it works

At the heart of StackView are three layers of embedded [DesktopContainers](https://documentation.xojo.com/api/user_interface/desktop/desktopcontainer.html).

The top layer is a DesktopContainer of type [ViewController](https://xojo.gitbook.io/add-ons/stackview/version-3/details/viewcontroller) `3`. You design your interface on a ViewController.

Each ViewController is embedded in another DesktopContainer of type [StackController](https://xojo.gitbook.io/add-ons/stackview/version-3/details/stackcontroller) `2`. The StackController is responsible for showing and hiding the embedded ViewControllers and provide a heading as well.

Finally StackControllers are embedded in a DesktopContainer of type [ScrollController](https://xojo.gitbook.io/add-ons/stackview/version-3/details/scrollcontroller) `1` . These deal with scrolling if the shown embedded controls take up more space when is available.

![Structure](https://3296382369-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LMJF6lPoRP6_dqCo8LI%2F-LMNHpZuorDwy-EygOrc%2F-LMNHsZHBj_YMmwve3Bl%2FStructure.png?alt=media\&token=cccfb98d-d15e-47f7-98cb-991c430a96f1)
