FilamentViewState
class FilamentViewState
Hoisted handle to a FilamentView's live Filament objects. Create with rememberFilamentViewState, pass to a FilamentView, and use it for imperative access — picking, reading the viewport, or reaching the raw View/Renderer for advanced work.
view and renderer are null until the state is attached to an on-screen FilamentView, and become null again when that view leaves composition.
val viewState = rememberFilamentViewState()
FilamentView(scene = scene, viewState = viewState, ...)
// Pick on tap — pick() takes Compose coordinates (top-left origin), no flipping needed:
Modifier.pointerInput(Unit) {
detectTapGestures { offset ->
viewState.pick(offset.x.toInt(), offset.y.toInt()) { result -> ... }
}
}Content copied to clipboard