<div class='type'>Function</div>


<a id='references'></a>


<h2 id="controlledcomposition-applier-parent">ControlledComposition</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@TestOnly
public fun ControlledComposition(
    applier: Applier<*>,
    parent: CompositionContext,
): ControlledComposition
```


This method is a way to initiate a composition. Optionally, a `parent` `CompositionContext` can
be provided to make the composition behave as a sub-composition of the parent or a `Recomposer`
can be provided.

A controlled composition allows direct control of the composition instead of it being controlled
by the `Recomposer` passed ot the root composition.

It is important to call `Composition.dispose` this composer is no longer needed in order to
release resources.

#### Parameters

| | |
| --- | --- |
| applier | The `Applier` instance to be used in the composition. |
| parent | The parent `CompositionContext`. |