Hyperview

Hyperview

  • Guides
  • Examples
  • Reference
  • Blog

›Display Elements

Reference

  • Index

Behaviors

  • Behavior Attributes
  • <behavior>
  • Alert
  • Share

Display Elements

  • <doc>
  • <screen>
  • <header>
  • <body>
  • <view>
  • <text>
  • <image>
  • <list>
  • <section-list>
  • <section>
  • <section-title>
  • <items>
  • <item>
  • <spinner>
  • <web-view>

Input Elements

  • <form>
  • <text-field>
  • <select-single>
  • <select-multiple>
  • <option>
  • <picker-field>
  • <picker-item>
  • <switch>
  • <date-field>

Style Elements

  • <styles>
  • <style>
  • <modifier>

Hyperview Client

  • Hyperview component
  • Custom elements
  • Custom behaviors
  • Loading Screen

Hyperview Navigation

  • <navigator>
  • <nav-route>

<web-view>

The <web-view> element shows a web view with HTML content loaded via a URL.

<doc xmlns="https://hyperview.org/hyperview">
  <screen>
    <body style="Body">
      <web-view
        url="https://hyperview.org"
        activity-indicator-color="blue"
        injected-java-script="alert('Hello Hyperview user!')"
        show-loading-indicator="document-only"
      />
    </body>
  </screen>
</doc>

Structure

A <web-view> element can appear anywhere within a <body> element.

Attributes

  • url
  • html
  • activity-indicator-color
  • injected-java-script
  • show-loading-indicator
  • id

url

TypeRequired
stringYes (unless html attribute is set)

The URL to load in the web view.

html

TypeRequired
stringYes (unless url attribute is set)

The HTML content to load in the web view.

activity-indicator-color

TypeRequired
stringNo

A hexadecimal string or supported color name indicating the color of the spinner shown while the web view loads.

injected-java-script

TypeRequired
stringNo

A string of Javascript that gets injected into the loaded web view. Can be used to customize the loaded website.

show-loading-indicator

TypeRequired
all (default), document-onlyNo

An attribute specifying when to stop showing the web-view's loader. document-only specifies to stop loading after the document renders but before other subresources load. By default (all), shows loader until the whole page loads.

id

TypeRequired
stringNo

A global attribute uniquely identifying the element in the whole document.

Dispatching events from web views

Hyperview events can be dispatched from the javascript context of a web view using window.ReactNativeWebView.postMessage API. The message must be prefixed with the string hyperview:.

Example:

Web page JS code:

window.ReactNativeWebView.postMessage('hyperview:open-modal');

XML markup:

<behavior
  action="new"
  event-name="open-modal"
  trigger="on-event"
  href="/modal.xml"
/>
← <spinner><form> →
  • Structure
  • Attributes
  • Dispatching events from web views
Hyperview
Docs
ExamplesHyperview Reference
More
BlogGitHub
Copyright © 2025 Instawork