<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`Workspace`](Workspace) › [`setActiveLeaf`](Workspace/setActiveLeaf) ## Workspace.setActiveLeaf() method Sets the active leaf **Signature:** ```typescript setActiveLeaf(leaf: WorkspaceLeaf, params?: { focus?: boolean; }): void; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | <code>leaf</code> | [`WorkspaceLeaf`](WorkspaceLeaf) | The new active leaf | | <code>params</code> | <code>{ focus?: boolean; }</code> | <p>_(Optional)_ Parameter object of whether to set the focus.</p><p> 0.16.3</p> | **Returns:** `void`