openpencil/packages/docs/programmable/sdk/api/advanced/use-layer-tree.md
2026-03-24 23:24:08 +03:00

16 lines
438 B
Markdown

---
title: useLayerTree
description: Primitive context helper for LayerTreeRoot descendants.
---
# useLayerTree
`useLayerTree()` reads the local layer-tree context provided by `LayerTreeRoot`.
Use it inside custom layer-tree descendants that need access to tree items, selection state, expansion state, or row actions.
## Related APIs
- [LayerTreeRoot](../components/layer-tree-root)
- [LayerTreeItem](../components/layer-tree-item)