Skip to content

PlatformView

PlatformView names a platform view type and supplies a structured PlatformPayload of creation or update properties.

PlatformView("video_player", PlatformPayload{
{"source", std::string("intro.mp4")},
{"autoplay", true},
}).Events<PlaybackChanged>()

The matching PlatformModule owns native creation, property updates, events, placement, and disposal. .Events<Keys...>() declares typed platform event keys; handlers still attach with the normal .On<Key>(...) API.

Platform views participate in HuxerUI measurement and placement but retain platform-native rendering and input limitations. Composition capabilities vary by backend; avoid assuming arbitrary transforms, path clipping, or cross-surface blending without checking the platform guide.

  • PlatformView(std::string type, PlatformPayload properties = {}).
  • Events<Keys...>() declares dispatchable event types whose event signature, name, and payload decoder satisfy the platform event contract.
  • Common size, layout, semantics, and event modifiers apply where supported.

See PlatformModule for registering factories and PlatformView guide for backend constraints.