🚀 8.9 Released! → ⚡️ New Node-API Engine Preview, 📲 ns widget ios, 💅 Tailwind v4 and more...
Read Announcement

<Placeholder> allows adding native views directly in your markup without creating a full View wrapper for it. When NativeScript is constructing the UI and encounters a Placeholder element, it emits a creatingView event, allowing you to pass in any native view to be rendered by assigning it to the args.view parameter.

Props

...Inherited

For additional inherited properties, refer to the API Reference.

Events

creatingView

ts
on('creatingView', (args: CreateViewEventData) => {
  const placeholder = args.object as Placeholder
  args.view = someNativeView
})

Emitted when building the UI, the event args allow passing a native view instance back via args.view.

See CreateViewEventData

Previous
ListView