Hyperview

Hyperview

  • Guides
  • Examples
  • Reference
  • Blog

›Behaviors

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>

System Share

System-level sharing functionality can be triggered via behaviors. Typically, the resource being shared is a URL, but the shared data can also include a title, message, and subject.

Here's an example of a sharing a link to a website, with a message. The system sharing UI will let them send the link and message via email, SMS, or other app installed on their device.

<view style="Button">
  <behavior
    xmlns:share="https://hyperview.org/share"
    action="share"
    trigger="press"
    share:url="https://www.instawork.com"
    share:message="Check out this website!"
  />
  <text style="Button__Label">Share link</text>
</view>

Structure

Share attributes and elements require their own namespace:

https://hyperview.org/share

Share behaviors are created using the standard <behavior> element. To trigger a share behavior, just set the action attribute to "share". It's usually convenient to define the XML namespace on the <behavior> element too:

<behavior
  xmlns:share="https://hyperview.org/share"
  trigger="longPress"
  action="alert"
/>

Note that any standard trigger can be used, as long as it's supported by the element containing the <behavior>.

The shared message and url are defined as namespaced attributes on the <behavior> element:

<behavior
  xmlns:share="https://hyperview.org/share"
  trigger="longPress"
  action="share"
  share:url="https://www.xkcd.com"
  snare:message="Share website"
/>

Share attributes

The following attributes are part of the https://hyperview.org/share namespace.

dialog-title

TypeRequired
stringNo

The title that appears as part of the Share UI on Android devices.

subject

TypeRequired
stringNo

If the user chooses to share the content via email, this attribute will pre-populate the subject of the email.

message

TypeRequired
stringNo

The message to share. Either message or url must be provided. If neither is provided, the behavior is a no-op.

url

TypeRequired
stringNo

The url to share. Either message or url must be provided. If neither is provided, the behavior is a no-op.

title

TypeRequired
stringNo

The title of the message to share. A title can be included with either message or url.

← Alert<doc> →
  • Share attributes
    • dialog-title
    • subject
    • message
    • url
    • title
Hyperview
Docs
ExamplesHyperview Reference
More
BlogGitHub
Copyright © 2025 Instawork