HtmlView

<HtmlView> is a UI component that lets you show static HTML content.

See also: WebView.


  • Angular

  • Plain

  • React

  • Svelte

  • Vue

  • HTML

  • TypeScript

<HtmlView [html]="htmlString"></HtmlView>
import { Component } from '@angular/core'

@Component({
  moduleId: module.id,
  templateUrl: './usage.component.html'
})
export class HtmlViewUsageComponent {
  htmlString: string

  constructor() {
    this.htmlString = `<span>
                          <h1>HtmlView demo in <font color="blue">NativeScript</font> App</h1>
                        </span>`
  }
}
  • XML

  • TypeScript

<HtmlView loaded="onHtmlLoaded" />
import { HtmlView } from '@nativescript/core'

export function onHtmlLoaded(args) {
  const myHtmlView = args.object as HtmlView
  myHtmlView.html = `<span>
        <h1><font color=\"blue\">NativeScript HtmlView</font></h1></br>
        <h3>This component accept simple HTML strings</h3></span>`
}
<htmlView html="<div><h1>HtmlView</h1></div>" />
<htmlView html="<div><h1>HtmlView</h1></div>" />
<HtmlView html="<div><h1>HtmlView</h1></div>" />

Props

Name Type Description

html

String

The HTML content to be shown.

...Inherited

Inherited

Additional inherited properties are not shown. Refer to the API Reference

Native component