# Context.viewer
URL: https://lsd.tools/docs/api-context-viewer
Updated: 2026-07-17

## Example

```python
@tool.command("demo/frame")
def frame(ctx: Context):
    if ctx.viewer:
        ctx.viewer.fit()
```

## Notes

A lazily populated slot — `None` when no viewer is available. Use it to drive the camera, layers, and
drawing on the open viewer.

## See also

**API:** [ui](/docs/api-context-ui) · [panel](/docs/api-context-panel) · [Context](/docs/api-context)

**Guides:** [Commands & actions](/docs/tools-commands-actions)
